Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to Swift 5.0 #11

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode10.1
osx_image: xcode11
git:
submodules: false
before_install:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "typelift/Swiftz" ~> 0.7.0
github "pushp1989/Swiftz"
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "typelift/SwiftCheck" ~> 0.8.1
github "https://github.com/pushp1989/SwiftCheck.git"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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).
27 changes: 18 additions & 9 deletions Tyro.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */;
Expand Down Expand Up @@ -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;
};
Expand All @@ -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;
};
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down Expand Up @@ -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 = "";
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -1476,7 +1483,7 @@
PRODUCT_NAME = Tyro;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -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;
};
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -1560,7 +1569,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1583,7 +1592,7 @@
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -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;
};
Expand All @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions Tyro/EncodedTypes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public struct FromJSONArray<A, B : FromJSON>: 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))"))
}
}
}
Expand All @@ -36,7 +36,7 @@ public struct FromJSONDictionary<A, B : FromJSON>: 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)"))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tyro/Enum.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)"))
}
}
}
Expand All @@ -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)"))
}
}
}
Expand Down