diff --git a/.swift-version b/.swift-version new file mode 100644 index 0000000..9f55b2c --- /dev/null +++ b/.swift-version @@ -0,0 +1 @@ +3.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 190f364..3be7f6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2.1.0 +This is for Xcode 8.1, Swift 3.0.1 + # 2.0.0 This is the Swift 3.0 compatible version. diff --git a/Gemfile.lock b/Gemfile.lock index 8f1883e..94b7d64 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,7 @@ GEM remote: https://rubygems.org/ specs: + CFPropertyList (2.3.3) activesupport (4.2.7.1) i18n (~> 0.7) json (~> 1.7, >= 1.7.7) @@ -9,29 +10,29 @@ GEM tzinfo (~> 1.1) addressable (2.4.0) babosa (1.0.2) - cert (1.4.2) - fastlane_core (>= 0.50.3, < 1.0.0) - spaceship (>= 0.32.0, < 1.0.0) - claide (1.0.0) + cert (1.4.3) + fastlane_core (>= 0.52.1, < 1.0.0) + spaceship (>= 0.34.2, < 1.0.0) + claide (1.0.1) clamp (0.6.5) colored (1.2) commander (4.4.0) highline (~> 1.7.2) - credentials_manager (0.16.0) + credentials_manager (0.16.2) colored commander (>= 4.3.5) highline (>= 1.7.1) security - deliver (1.13.3) - credentials_manager (>= 0.16.0, < 1.0.0) + deliver (1.14.5) + credentials_manager (>= 0.16.2, < 1.0.0) fastimage (~> 1.6) - fastlane_core (>= 0.50.3, < 1.0.0) - plist (~> 3.1.0) - spaceship (>= 0.31.6, < 1.0.0) - domain_name (0.5.20160615) + fastlane_core (>= 0.53.0, < 1.0.0) + plist (>= 3.1.0, < 4.0.0) + spaceship (>= 0.36.2, < 1.0.0) + domain_name (0.5.20161021) unf (>= 0.0.5, < 1.0.0) dotenv (2.1.1) - excon (0.45.4) + excon (0.54.0) faraday (0.9.2) multipart-post (>= 1.2, < 3) faraday-cookie_jar (0.0.6) @@ -41,56 +42,56 @@ GEM faraday (>= 0.7.4, < 0.10) fastimage (1.6.8) addressable (~> 2.3, >= 2.3.5) - fastlane (1.102.0) + fastlane (1.106.2) activesupport (< 5) - addressable (~> 2.3) + addressable (>= 2.3, < 3.0.0) bundler (~> 1.12) - cert (>= 1.4.1, < 2.0.0) - credentials_manager (>= 0.16.0, < 1.0.0) - deliver (>= 1.13.3, < 2.0.0) - fastlane_core (>= 0.50.2, < 1.0.0) - frameit (>= 2.7.0, < 3.0.0) - gym (>= 1.7.0, < 2.0.0) - krausefx-shenzhen (>= 0.14.10) - match (>= 0.6.3, < 1.0.0) + cert (>= 1.4.3, < 2.0.0) + credentials_manager (>= 0.16.2, < 1.0.0) + deliver (>= 1.14.4, < 2.0.0) + fastlane_core (>= 0.53.0, < 1.0.0) + frameit (>= 3.0.0, < 4.0.0) + gym (>= 1.11.3, < 2.0.0) + krausefx-shenzhen (>= 0.14.10, < 1.0.0) + match (>= 0.9.0, < 1.0.0) multipart-post (~> 2.0.0) pem (>= 1.3.2, < 2.0.0) - pilot (>= 1.10.0, < 2.0.0) - plist (~> 3.1.0) - produce (>= 1.2.0, < 2.0.0) - scan (>= 0.11.3, < 2.0.0) - screengrab (>= 0.5.0, < 1.0.0) - sigh (>= 1.10.0, < 2.0.0) - slack-notifier (~> 1.3) - snapshot (>= 1.14.0, < 2.0.0) - spaceship (>= 0.32.0, < 1.0.0) - supply (>= 0.7.0, < 1.0.0) - terminal-notifier (~> 1.6.2) - terminal-table (~> 1.4.5) + pilot (>= 1.11.1, < 2.0.0) + plist (>= 3.1.0, < 4.0.0) + produce (>= 1.2.1, < 2.0.0) + scan (>= 0.13.1, < 1.0.0) + screengrab (>= 0.5.2, < 1.0.0) + sigh (>= 1.11.2, < 2.0.0) + slack-notifier (>= 1.3, < 2.0.0) + snapshot (>= 1.16.2, < 2.0.0) + spaceship (>= 0.36.2, < 1.0.0) + supply (>= 0.7.1, < 1.0.0) + terminal-notifier (>= 1.6.2, < 2.0.0) + terminal-table (>= 1.4.5, < 2.0.0) word_wrap (~> 1.0.0) xcode-install (~> 2.0.0) xcodeproj (>= 0.20, < 2.0.0) - xcpretty (>= 0.2.1) - fastlane_core (0.50.3) + xcpretty (>= 0.2.4, < 1.0.0) + fastlane_core (0.53.0) babosa colored commander (>= 4.4.0, <= 5.0.0) - credentials_manager (>= 0.16.0, < 1.0.0) - excon (~> 0.45.0) + credentials_manager (>= 0.16.2, < 1.0.0) + excon (>= 0.45.0, < 1.0) gh_inspector (>= 1.0.1, < 2.0.0) highline (>= 1.7.2) json multi_json - plist (~> 3.1) + plist (>= 3.1.0, < 4.0.0) rubyzip (~> 1.1.6) - terminal-table (~> 1.4.5) - frameit (2.7.0) + terminal-table (>= 1.4.5, < 2.0.0) + frameit (3.0.0) deliver (> 0.3) fastimage (~> 1.6.3) - fastlane_core (>= 0.36.1, < 1.0.0) + fastlane_core (>= 0.53.0, < 1.0.0) mini_magick (~> 4.5.1) gh_inspector (1.0.2) - google-api-client (0.9.13) + google-api-client (0.9.19) addressable (~> 2.3) googleauth (~> 0.5) httpclient (~> 2.7) @@ -107,20 +108,20 @@ GEM multi_json (~> 1.11) os (~> 0.9) signet (~> 0.7) - gym (1.8.0) - fastlane_core (>= 0.50.0, < 1.0.0) - plist + gym (1.11.3) + fastlane_core (>= 0.52.1, < 1.0.0) + plist (>= 3.1.0, < 4.0.0) rubyzip (>= 1.1.7) - terminal-table - xcpretty (>= 0.2.1) + terminal-table (>= 1.4.5, < 2.0.0) + xcpretty (>= 0.2.4, < 1.0.0) highline (1.7.8) - http-cookie (1.0.2) + http-cookie (1.0.3) domain_name (~> 0.5) - httpclient (2.8.2.3) + httpclient (2.8.2.4) hurley (0.2) i18n (0.7.0) json (1.8.3) - jwt (1.5.4) + jwt (1.5.6) krausefx-shenzhen (0.14.10) commander (>= 4.3, < 5.0) dotenv (>= 0.7) @@ -137,61 +138,60 @@ GEM logging (2.1.0) little-plugger (~> 1.1) multi_json (~> 1.10) - match (0.6.3) - cert (>= 1.4.1, < 2.0.0) - credentials_manager (>= 0.16.0, < 1.0.0) - fastlane_core (>= 0.50.3, < 1.0.0) + match (0.10.0) + cert (>= 1.4.3, < 2.0.0) + credentials_manager (>= 0.16.2, < 1.0.0) + fastlane_core (>= 0.53.0, < 1.0.0) security - sigh (>= 1.9.0, < 2.0.0) - spaceship (>= 0.31.10, < 1.0.0) + sigh (>= 1.11.2, < 2.0.0) + spaceship (>= 0.36.1, < 1.0.0) memoist (0.15.0) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_magick (4.5.1) mini_portile2 (2.1.0) - minitest (5.9.0) + minitest (5.9.1) multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) + nanaimo (0.1.2) net-sftp (2.1.2) net-ssh (>= 2.6.5) net-ssh (3.2.0) - nokogiri (1.6.8) + nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) - pkg-config (~> 1.1.7) os (0.9.6) pem (1.3.2) fastlane_core (>= 0.43.1, < 1.0.0) spaceship (>= 0.26.2, < 1.0.0) - pilot (1.10.0) - credentials_manager (>= 0.3.0) - fastlane_core (>= 0.46.2, < 1.0.0) - spaceship (>= 0.29.0, < 1.0.0) - terminal-table (~> 1.4.5) - pkg-config (1.1.7) + pilot (1.11.1) + credentials_manager (>= 0.16.0) + fastlane_core (>= 0.53.0, < 1.0.0) + spaceship (>= 0.36.2, < 1.0.0) + terminal-table (>= 1.4.5, < 2.0.0) plist (3.1.0) - produce (1.2.0) - fastlane_core (>= 0.30.0, < 1.0.0) - spaceship (>= 0.31.1, < 1.0.0) + produce (1.2.1) + fastlane_core (>= 0.52.1, < 1.0.0) + spaceship (>= 0.34.2, < 1.0.0) representable (2.3.0) uber (~> 0.0.7) retriable (2.1.0) rouge (1.11.1) rubyzip (1.1.7) - scan (0.11.3) - fastlane_core (>= 0.50.0, < 1.0.0) + scan (0.13.1) + fastlane_core (>= 0.52.1, < 1.0.0) slack-notifier (~> 1.3) terminal-table - xcpretty (>= 0.2.1) + xcpretty (>= 0.2.2) xcpretty-travis-formatter (>= 0.0.3) - screengrab (0.5.1) - fastlane_core (>= 0.50.3, < 1.0.0) + screengrab (0.5.5) + fastlane_core (>= 0.52.1, < 1.0.0) security (0.1.3) - sigh (1.10.1) - fastlane_core (>= 0.36.1, < 1.0.0) + sigh (1.11.2) + fastlane_core (>= 0.52.1, < 1.0.0) plist (~> 3.1) - spaceship (>= 0.29.1, < 1.0.0) + spaceship (>= 0.34.2, < 1.0.0) signet (0.7.3) addressable (~> 2.3) faraday (~> 0.9) @@ -203,12 +203,12 @@ GEM clamp (~> 0.6) nokogiri (~> 1.6.3) xcodeproj (>= 0.20, < 2.0.0) - snapshot (1.14.0) + snapshot (1.16.3) fastimage (~> 1.6.3) - fastlane_core (>= 0.50.3, < 1.0.0) - plist (~> 3.1.0) - xcpretty (>= 0.2.1) - spaceship (0.32.0) + fastlane_core (>= 0.53.0, < 1.0.0) + plist (>= 3.1.0, < 4.0.0) + xcpretty (>= 0.2.4, < 1.0.0) + spaceship (0.36.2) colored credentials_manager (>= 0.16.0) faraday (~> 0.9) @@ -216,12 +216,12 @@ GEM faraday_middleware (~> 0.9) fastimage (~> 1.6) multi_xml (~> 0.5) - plist (~> 3.1) + plist (>= 3.1.0, < 4.0.0) supply (0.7.1) credentials_manager (>= 0.15.0) fastlane_core (>= 0.43.4) google-api-client (~> 0.9.1) - terminal-notifier (1.6.3) + terminal-notifier (1.7.1) terminal-table (1.4.5) thread_safe (0.3.5) tzinfo (1.2.2) @@ -231,14 +231,16 @@ GEM unf_ext unf_ext (0.0.7.2) word_wrap (1.0.0) - xcode-install (2.0.2) + xcode-install (2.0.8) claide (>= 0.9.1, < 1.1.0) spaceship (>= 0.25.1, < 1.0.0) - xcodeproj (1.2.0) + xcodeproj (1.4.0) + CFPropertyList (~> 2.3.3) activesupport (>= 3) - claide (>= 1.0.0, < 2.0) + claide (>= 1.0.1, < 2.0) colored (~> 1.2) - xcpretty (0.2.2) + nanaimo (~> 0.1.0) + xcpretty (0.2.4) rouge (~> 1.8) xcpretty-travis-formatter (0.0.4) xcpretty (~> 0.2, >= 0.0.7) @@ -253,4 +255,4 @@ DEPENDENCIES xcpretty BUNDLED WITH - 1.12.5 + 1.13.6 diff --git a/Sources/ValueCoding.swift b/Sources/ValueCoding.swift index 9dec72b..290b90f 100644 --- a/Sources/ValueCoding.swift +++ b/Sources/ValueCoding.swift @@ -76,7 +76,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self { be of `Coder` type. - returns: an optional `Self` */ - static func decode(_ object: AnyObject?) -> Self? { + static func decode(_ object: Any?) -> Self? { return (object as? Coder)?.value } @@ -89,7 +89,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self { - parameter objects: a `SequenceType` of `AnyObject`. - returns: the array of values which were able to be unarchived. */ - static func decode(_ objects: S?) -> [Self] where S.Iterator.Element: AnyObject { + static func decode(_ objects: S?) -> [Self] where S.Iterator.Element: Any { return objects?.flatMap(Self.decode) ?? [] } @@ -99,7 +99,7 @@ public extension ValueCoding where Coder: NSCoding, Coder.Value == Self { - parameter objects: a `SequenceType` of `SequenceType` of `AnyObject`. - returns: the array of arrays of values which were able to be unarchived. */ - static func decode(_ objects: S?) -> [[Self]] where S.Iterator.Element: Sequence, S.Iterator.Element.Iterator.Element: AnyObject { + static func decode(_ objects: S?) -> [[Self]] where S.Iterator.Element: Sequence, S.Iterator.Element.Iterator.Element: Any { return objects?.flatMap(Self.decode) ?? [] } diff --git a/Supporting Files/ValueCoding.xcconfig b/Supporting Files/ValueCoding.xcconfig index 6c60088..37abc2d 100644 --- a/Supporting Files/ValueCoding.xcconfig +++ b/Supporting Files/ValueCoding.xcconfig @@ -43,3 +43,4 @@ LD_RUNPATH_SEARCH_PATHS_framework = @executable_path/../Frameworks @loader_path/ LD_RUNPATH_SEARCH_PATHS_xctest = @loader_path/Frameworks @executable_path/Frameworks @loader_path/../Frameworks @executable_path/../Frameworks LD_RUNPATH_SEARCH_PATHS = $(LD_RUNPATH_SEARCH_PATHS_$(WRAPPER_EXTENSION)) +#include "Warnings.xcconfig" diff --git a/Supporting Files/Version.xcconfig b/Supporting Files/Version.xcconfig index 42a4673..70e6e70 100644 --- a/Supporting Files/Version.xcconfig +++ b/Supporting Files/Version.xcconfig @@ -1 +1 @@ -VALUECODING_VERSION = 2.0.0 +VALUECODING_VERSION = 2.1.0 diff --git a/Supporting Files/Warnings.xcconfig b/Supporting Files/Warnings.xcconfig new file mode 100644 index 0000000..676b23d --- /dev/null +++ b/Supporting Files/Warnings.xcconfig @@ -0,0 +1,27 @@ +// +// ValueCoding +// +// Copyright © 2016 ProcedureKit. All rights reserved. +// + +CLANG_WARN_DOCUMENTATION_COMMENTS = YES +CLANG_WARN_BOOL_CONVERSION = YES +CLANG_WARN_CONSTANT_CONVERSION = YES +CLANG_WARN_EMPTY_BODY = YES +CLANG_WARN_ENUM_CONVERSION = YES +CLANG_WARN_INFINITE_RECURSION = YES +CLANG_WARN_INT_CONVERSION = YES +CLANG_WARN_SUSPICIOUS_MOVE = YES +CLANG_WARN_UNREACHABLE_CODE = YES +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +ENABLE_STRICT_OBJC_MSGSEND = YES +ENABLE_TESTABILITY = YES +GCC_NO_COMMON_BLOCKS = YES +GCC_WARN_64_TO_32_BIT_CONVERSION = YES +GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR +GCC_WARN_UNDECLARED_SELECTOR = YES +GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE +GCC_WARN_UNUSED_FUNCTION = YES +GCC_WARN_UNUSED_VARIABLE = YES +CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR +CLANG_ANALYZER_NONNULL = YES diff --git a/Tests/ValueCodingTests.swift b/Tests/ValueCodingTests.swift index 4feb05e..c4b79c4 100644 --- a/Tests/ValueCodingTests.swift +++ b/Tests/ValueCodingTests.swift @@ -55,12 +55,12 @@ class ValueCodingTests: XCTestCase { } func test__multiple_archiving() { - let unarchived = Foo.decode(items.encoded) + let unarchived: [Foo] = Foo.decode(items.encoded) XCTAssertEqual(unarchived, items) } func test__nested_archiving() { - let unarchived = Foo.decode(nested.encoded) + let unarchived: [[Foo]] = Foo.decode(nested.encoded) XCTAssertEqual(unarchived.count, 1) XCTAssertEqual(unarchived[0], nested[0]) } diff --git a/ValueCoding.podspec b/ValueCoding.podspec index 09e685e..3c62ec0 100644 --- a/ValueCoding.podspec +++ b/ValueCoding.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "ValueCoding" - s.version = "2.0.0" + s.version = "2.1.0" s.summary = "Swift protocols for encoding/decoding value types." s.description = <<-DESC diff --git a/ValueCoding.xcodeproj/project.pbxproj b/ValueCoding.xcodeproj/project.pbxproj index a26c910..a822611 100644 --- a/ValueCoding.xcodeproj/project.pbxproj +++ b/ValueCoding.xcodeproj/project.pbxproj @@ -27,6 +27,7 @@ /* Begin PBXFileReference section */ 658A7B5C1D776B7600F897C8 /* ValueCoding.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ValueCoding.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 658A7B651D776B7600F897C8 /* ValueCodingTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ValueCodingTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 65A3B8821DC659FE0042BB95 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 65CF6F511D776BBC004B3503 /* ValueCoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValueCoding.swift; sourceTree = ""; }; 65CF6F531D776BBC004B3503 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65CF6F541D776BBC004B3503 /* ValueCoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ValueCoding.h; sourceTree = ""; }; @@ -60,8 +61,7 @@ children = ( 65CF6F501D776BBC004B3503 /* Sources */, 65CF6F5A1D77744D004B3503 /* Tests */, - 65CF6F521D776BBC004B3503 /* Supporting Files */, - 658A7B5D1D776B7600F897C8 /* Products */, + 65A3B8811DC659EA0042BB95 /* ... */, ); sourceTree = ""; }; @@ -74,6 +74,15 @@ name = Products; sourceTree = ""; }; + 65A3B8811DC659EA0042BB95 /* ... */ = { + isa = PBXGroup; + children = ( + 65CF6F521D776BBC004B3503 /* Supporting Files */, + 658A7B5D1D776B7600F897C8 /* Products */, + ); + name = ...; + sourceTree = ""; + }; 65CF6F501D776BBC004B3503 /* Sources */ = { isa = PBXGroup; children = ( @@ -89,6 +98,7 @@ 65CF6F531D776BBC004B3503 /* Info.plist */, 65CF6F591D77704D004B3503 /* ValueCoding.xcconfig */, 65CF6F581D776BD5004B3503 /* Version.xcconfig */, + 65A3B8821DC659FE0042BB95 /* Warnings.xcconfig */, ); path = "Supporting Files"; sourceTree = ""; @@ -159,7 +169,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0810; TargetAttributes = { 658A7B5B1D776B7600F897C8 = { CreatedOnToolsVersion = 8.0; @@ -241,6 +251,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 65CF6F591D77704D004B3503 /* ValueCoding.xcconfig */; buildSettings = { + ONLY_ACTIVE_ARCH = YES; }; name = Debug; }; diff --git a/ValueCoding.xcodeproj/xcshareddata/xcschemes/ValueCoding.xcscheme b/ValueCoding.xcodeproj/xcshareddata/xcschemes/ValueCoding.xcscheme index 8362628..089de83 100644 --- a/ValueCoding.xcodeproj/xcshareddata/xcschemes/ValueCoding.xcscheme +++ b/ValueCoding.xcodeproj/xcshareddata/xcschemes/ValueCoding.xcscheme @@ -1,6 +1,6 @@