diff --git a/.gitmodules b/.gitmodules index d1bd3a5..43fda42 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "Carthage/Checkouts/Swiftz"] - url = https://github.com/typelift/Swiftz.git + url = https://github.com/pushp1989/Swiftz.git path = Carthage/Checkouts/Swiftz [submodule "Carthage/Checkouts/SwiftCheck"] path = Carthage/Checkouts/SwiftCheck - url = https://github.com/typelift/SwiftCheck.git + url = https://github.com/pushp1989/SwiftCheck.git diff --git a/.travis.yml b/.travis.yml index 665a53b..421421d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode10.1 +osx_image: xcode11 git: submodules: false before_install: @@ -11,11 +11,11 @@ script: - set -o pipefail - xcodebuild test -scheme Tyro -configuration Debug | xcpretty -c - xcodebuild clean -scheme Tyro -configuration Debug - - xcodebuild test -scheme Tyro-iOS -configuration Debug -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6s" | xcpretty -c + - xcodebuild test -scheme Tyro-iOS -configuration Debug -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 8" -UseModernBuildSystem=NO | xcpretty -c - xcodebuild clean -scheme Tyro-iOS -configuration Debug -sdk iphonesimulator - - xcodebuild test -scheme Tyro-tvOS -destination 'platform=tvOS Simulator,name=Apple TV' | xcpretty -c + - xcodebuild test -scheme Tyro-tvOS -destination 'platform=tvOS Simulator,name=Apple TV' -UseModernBuildSystem=NO | xcpretty -c - xcodebuild clean -scheme Tyro-tvOS - - xcodebuild build -scheme Tyro-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch - 42mm' | xcpretty -c + - xcodebuild build -scheme Tyro-watchOS -destination 'platform=watchOS Simulator,name=Apple Watch Series 4 - 44mm' -UseModernBuildSystem=NO | xcpretty -c # deploy: # provider: script # script: ./scripts/push.sh diff --git a/Cartfile b/Cartfile index 01417a0..2f1885f 100644 --- a/Cartfile +++ b/Cartfile @@ -1 +1 @@ -github "typelift/Swiftz" ~> 0.7.0 +github "pushp1989/Swiftz" "f6c693a7a5caa77628b561be366808e9bc438caa" diff --git a/Cartfile.private b/Cartfile.private index 5157273..4ba6a51 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1 +1 @@ -github "typelift/SwiftCheck" ~> 0.8.1 +github "pushp1989/SwiftCheck" "cfe6eb2a27097ff071f278d3c0f40fa11e42b0aa" diff --git a/Carthage/Checkouts/SwiftCheck b/Carthage/Checkouts/SwiftCheck index cf99580..cfe6eb2 160000 --- a/Carthage/Checkouts/SwiftCheck +++ b/Carthage/Checkouts/SwiftCheck @@ -1 +1 @@ -Subproject commit cf9958085b2ee1643e541e407c3233d1b76c18ff +Subproject commit cfe6eb2a27097ff071f278d3c0f40fa11e42b0aa diff --git a/Carthage/Checkouts/Swiftz b/Carthage/Checkouts/Swiftz index 973ff0f..f5b9278 160000 --- a/Carthage/Checkouts/Swiftz +++ b/Carthage/Checkouts/Swiftz @@ -1 +1 @@ -Subproject commit 973ff0f61c424e9296fd45c2bff5e5e7582fd8fa +Subproject commit f5b9278eeaaeb2b4ef181616c15e03fdc6070771 diff --git a/README.md b/README.md index 18d0639..d34d34a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Tyro ====== -Tyro is a Swift library for Functional JSON parsing and encoding. It is now supported on this repo for Swift 4.2 but used +Tyro is a Swift library for Functional JSON parsing and encoding. It is now supported on this repo for Swift 5.0 but used to be maintained by [typelift](https://github.com/typelift/tyro). diff --git a/Tyro.xcodeproj/project.pbxproj b/Tyro.xcodeproj/project.pbxproj index a9a877f..5be97ce 100644 --- a/Tyro.xcodeproj/project.pbxproj +++ b/Tyro.xcodeproj/project.pbxproj @@ -796,10 +796,11 @@ }; buildConfigurationList = DE702CCA1BFAC6820017CEE8 /* Build configuration list for PBXProject "Tyro" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = DE702CC61BFAC6820017CEE8; productRefGroup = DE702CD11BFAC6830017CEE8 /* Products */; @@ -1249,6 +1250,7 @@ PRODUCT_NAME = Tyro; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; }; @@ -1270,6 +1272,7 @@ PRODUCT_NAME = Tyro; SDKROOT = appletvos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; }; @@ -1284,6 +1287,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.typelift.Tyro-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Debug; @@ -1297,6 +1301,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.typelift.Tyro-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; + SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Release; @@ -1318,6 +1323,7 @@ PRODUCT_NAME = Tyro; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.2; }; @@ -1340,6 +1346,7 @@ PRODUCT_NAME = Tyro; SDKROOT = watchos; SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.2; }; @@ -1396,7 +1403,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1447,7 +1454,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -1476,7 +1483,7 @@ PRODUCT_NAME = Tyro; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1500,7 +1507,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.typelift.Tyro; PRODUCT_NAME = Tyro; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1519,6 +1526,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.typelift.TyroTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Debug; @@ -1537,6 +1545,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.typelift.TyroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; }; name = Release; @@ -1560,7 +1569,7 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1583,7 +1592,7 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -1600,7 +1609,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -1617,7 +1626,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Tyro/EncodedTypes.swift b/Tyro/EncodedTypes.swift index 0fa5d27..c4758a7 100644 --- a/Tyro/EncodedTypes.swift +++ b/Tyro/EncodedTypes.swift @@ -16,7 +16,7 @@ public struct FromJSONArray: FromJSON where B.T == A { case .Array(let values): return values.compactMap(B.fromJSON).lift().either(onLeft: { .Left(.Array($0)) }, onRight: Either.Right) default: - return .Left(.TypeMismatch("\(JSONValue.Array.self)", "\(type(of: value))")) + return .Left(.TypeMismatch("\(String(describing: JSONValue.Array.self))", "\(type(of: value))")) } } } @@ -36,7 +36,7 @@ public struct FromJSONDictionary: FromJSON where B.T == A { case .Object(let value): return value.mapMaybe(B.fromJSON).lift().either(onLeft: { .Left(.Array($0)) }, onRight: Either.Right) default: - return .Left(.TypeMismatch("\(JSONValue.Object.self)", "\(type(of: value).self)")) + return .Left(.TypeMismatch("\(String(describing: JSONValue.Object.self))", "\(type(of: value).self)")) } } } diff --git a/Tyro/Enum.swift b/Tyro/Enum.swift index 88d9b88..a398e8f 100644 --- a/Tyro/Enum.swift +++ b/Tyro/Enum.swift @@ -17,7 +17,7 @@ extension FromJSON where Self : RawRepresentable, Self.RawValue == Int { let x : T? = self.init(rawValue : n) as? T return x.toEither(.Custom("Raw value could not be converted")) default: - return .Left(.TypeMismatch("\(JSONValue.Number.self)","\(value.self)")) + return .Left(.TypeMismatch("\(String(describing: JSONValue.Number.self))","\(value.self)")) } } } @@ -37,7 +37,7 @@ extension FromJSON where Self : RawRepresentable, Self.RawValue == String { let x : T? = self.init(rawValue : s) as? T return x.toEither(.Custom("Raw value could not be converted")) default: - return .Left(.TypeMismatch("\(JSONValue.Number.self)","\(value.self)")) + return .Left(.TypeMismatch("\(String(describing: JSONValue.Number.self))","\(value.self)")) } } }