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

Configure for Swift 5 #522

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 0 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ matrix:
- xcode_scheme: Apollo
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
- xcode_scheme: Apollo
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
- xcode_scheme: Apollo
xcode_sdk: appletvsimulator12.2
env: DESTINATION="platform=tvOS Simulator,OS=12.2,name=Apple TV"
Expand All @@ -34,9 +31,6 @@ matrix:
- xcode_scheme: ApolloSQLite
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
- xcode_scheme: ApolloSQLite
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
- xcode_scheme: ApolloWebSocket
xcode_sdk: macosx10.14
env: DESTINATION="platform=macOS,arch=x86_64"
Expand All @@ -49,9 +43,6 @@ matrix:
- xcode_scheme: ApolloWebSocket
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
- xcode_scheme: ApolloWebSocket
xcode_sdk: iphonesimulator12.2
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"

cache:
directories:
Expand Down
17 changes: 8 additions & 9 deletions Apollo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -869,17 +869,17 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Apollo GraphQL";
TargetAttributes = {
9F8A95771EC0FC1200304A2D = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9FA6ABBB1EC0A988000017BE = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9FACA9B71F42E67200AE2DBD = {
Expand All @@ -893,18 +893,18 @@
9FC750431D2A532C00458D91 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeamName = "Martijn Walraven";
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9FC7504D1D2A532D00458D91 = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeamName = "Martijn Walraven";
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9FCE2CF91E6C213D00E34457 = {
CreatedOnToolsVersion = 8.2.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
9FD637E01E6ACF88001EDBC8 = {
Expand All @@ -915,10 +915,9 @@
};
buildConfigurationList = 9FC7503E1D2A532C00458D91 /* Build configuration list for PBXProject "Apollo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -1006,7 +1005,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -x";
shellScript = "APOLLO_FRAMEWORK_PATH=$(eval find $FRAMEWORK_SEARCH_PATHS -name \"Apollo.framework\" -maxdepth 1)\n\nif [ -z \"$APOLLO_FRAMEWORK_PATH\" ]; then\necho \"error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project.\"\nexit 1\nfi\n\ncd ${SRCROOT}/Tests/StarWarsAPI\n$(find $APOLLO_FRAMEWORK_PATH/ -name 'check-and-run-apollo-cli.sh') codegen:generate --queries=\"$(find . -name '*.graphql')\" --schema=schema.json --mergeInFieldsFromFragmentSpreads API.swift";
shellScript = "APOLLO_FRAMEWORK_PATH=$(eval find $FRAMEWORK_SEARCH_PATHS -name \"Apollo.framework\" -maxdepth 1)\n\nif [ -z \"$APOLLO_FRAMEWORK_PATH\" ]; then\necho \"error: Couldn't find Apollo.framework in FRAMEWORK_SEARCH_PATHS; make sure to add the framework to your project.\"\nexit 1\nfi\n\ncd ${SRCROOT}/Tests/StarWarsAPI\n$(find $APOLLO_FRAMEWORK_PATH/ -name 'check-and-run-apollo-cli.sh') codegen:generate --queries=\"$(find . -name '*.graphql')\" --schema=schema.json --mergeInFieldsFromFragmentSpreads API.swift\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
2 changes: 1 addition & 1 deletion Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
6 changes: 3 additions & 3 deletions ApolloSQLite.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1020;
TargetAttributes = {
543806941EA56C2200F55B72 = {
CreatedOnToolsVersion = 8.3.1;
Expand All @@ -336,11 +336,11 @@
};
buildConfigurationList = 54DDB0B81EA1523E0009DD99 /* Build configuration list for PBXProject "ApolloSQLite" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 54DDB0B41EA1523E0009DD99;
productRefGroup = 54DDB0BF1EA1523E0009DD99 /* Products */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
1 change: 1 addition & 0 deletions ApolloWebSocket.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 720160C1206AB3D30052B2EE;
productRefGroup = 720160CC206AB3D30052B2EE /* Products */;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
3 changes: 2 additions & 1 deletion Configuration/Shared/Workspace-Language.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ CLANG_MODULES_AUTOLINK = YES

CLANG_CXX_LANGUAGE_STANDARD = gnu++11
CLANG_CXX_LIBRARY = libc++
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES

ENABLE_STRICT_OBJC_MSGSEND = YES

// Swift
SWIFT_VERSION = 4.2
SWIFT_VERSION = 5.0
SWIFT_PRECOMPILE_BRIDGING_HEADER = YES
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(CONFIGURATION:upper)
SWIFT_SWIFT3_OBJC_INFERENCE = Off
2 changes: 1 addition & 1 deletion Sources/Apollo/Collections.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct GroupedSequence<Key: Equatable, Value> {
fileprivate var groupsForKeys: [[Value]] = []

mutating func append(value: Value, forKey key: Key) -> (Int, Int) {
if let index = keys.index(where: { $0 == key }) {
if let index = keys.firstIndex(where: { $0 == key }) {
groupsForKeys[index].append(value)
return (index, groupsForKeys[index].endIndex - 1)
} else {
Expand Down