Skip to content

Commit 05b53f9

Browse files
committed
Configure for Swift 5
1 parent 75bd7e9 commit 05b53f9

10 files changed

Lines changed: 19 additions & 27 deletions

File tree

.travis.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ matrix:
1616
- xcode_scheme: Apollo
1717
xcode_sdk: iphonesimulator12.2
1818
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
19-
- xcode_scheme: Apollo
20-
xcode_sdk: iphonesimulator12.2
21-
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
2219
- xcode_scheme: Apollo
2320
xcode_sdk: appletvsimulator12.2
2421
env: DESTINATION="platform=tvOS Simulator,OS=12.2,name=Apple TV"
@@ -34,9 +31,6 @@ matrix:
3431
- xcode_scheme: ApolloSQLite
3532
xcode_sdk: iphonesimulator12.2
3633
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
37-
- xcode_scheme: ApolloSQLite
38-
xcode_sdk: iphonesimulator12.2
39-
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
4034
- xcode_scheme: ApolloWebSocket
4135
xcode_sdk: macosx10.14
4236
env: DESTINATION="platform=macOS,arch=x86_64"
@@ -49,9 +43,6 @@ matrix:
4943
- xcode_scheme: ApolloWebSocket
5044
xcode_sdk: iphonesimulator12.2
5145
env: DESTINATION="platform=iOS Simulator,OS=10.3.1,name=iPhone 7"
52-
- xcode_scheme: ApolloWebSocket
53-
xcode_sdk: iphonesimulator12.2
54-
env: DESTINATION="platform=iOS Simulator,OS=9.3,name=iPhone 6s"
5546

5647
cache:
5748
directories:

Apollo.xcodeproj/project.pbxproj

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -869,17 +869,17 @@
869869
isa = PBXProject;
870870
attributes = {
871871
LastSwiftUpdateCheck = 0830;
872-
LastUpgradeCheck = 0940;
872+
LastUpgradeCheck = 1020;
873873
ORGANIZATIONNAME = "Apollo GraphQL";
874874
TargetAttributes = {
875875
9F8A95771EC0FC1200304A2D = {
876876
CreatedOnToolsVersion = 8.3.2;
877-
LastSwiftMigration = 0900;
877+
LastSwiftMigration = 1020;
878878
ProvisioningStyle = Manual;
879879
};
880880
9FA6ABBB1EC0A988000017BE = {
881881
CreatedOnToolsVersion = 8.3.2;
882-
LastSwiftMigration = 0900;
882+
LastSwiftMigration = 1020;
883883
ProvisioningStyle = Manual;
884884
};
885885
9FACA9B71F42E67200AE2DBD = {
@@ -893,18 +893,18 @@
893893
9FC750431D2A532C00458D91 = {
894894
CreatedOnToolsVersion = 8.0;
895895
DevelopmentTeamName = "Martijn Walraven";
896-
LastSwiftMigration = 0900;
896+
LastSwiftMigration = 1020;
897897
ProvisioningStyle = Manual;
898898
};
899899
9FC7504D1D2A532D00458D91 = {
900900
CreatedOnToolsVersion = 8.0;
901901
DevelopmentTeamName = "Martijn Walraven";
902-
LastSwiftMigration = 0900;
902+
LastSwiftMigration = 1020;
903903
ProvisioningStyle = Manual;
904904
};
905905
9FCE2CF91E6C213D00E34457 = {
906906
CreatedOnToolsVersion = 8.2.1;
907-
LastSwiftMigration = 0900;
907+
LastSwiftMigration = 1020;
908908
ProvisioningStyle = Manual;
909909
};
910910
9FD637E01E6ACF88001EDBC8 = {
@@ -915,10 +915,9 @@
915915
};
916916
buildConfigurationList = 9FC7503E1D2A532C00458D91 /* Build configuration list for PBXProject "Apollo" */;
917917
compatibilityVersion = "Xcode 3.2";
918-
developmentRegion = English;
918+
developmentRegion = en;
919919
hasScannedForEncodings = 0;
920920
knownRegions = (
921-
English,
922921
en,
923922
Base,
924923
);
@@ -1006,7 +1005,7 @@
10061005
);
10071006
runOnlyForDeploymentPostprocessing = 0;
10081007
shellPath = "/bin/sh -x";
1009-
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";
1008+
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";
10101009
};
10111010
/* End PBXShellScriptBuildPhase section */
10121011

Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0940"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0940"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

ApolloSQLite.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
isa = PBXProject;
317317
attributes = {
318318
LastSwiftUpdateCheck = 0830;
319-
LastUpgradeCheck = 0940;
319+
LastUpgradeCheck = 1020;
320320
TargetAttributes = {
321321
543806941EA56C2200F55B72 = {
322322
CreatedOnToolsVersion = 8.3.1;
@@ -336,11 +336,11 @@
336336
};
337337
buildConfigurationList = 54DDB0B81EA1523E0009DD99 /* Build configuration list for PBXProject "ApolloSQLite" */;
338338
compatibilityVersion = "Xcode 3.2";
339-
developmentRegion = English;
339+
developmentRegion = en;
340340
hasScannedForEncodings = 0;
341341
knownRegions = (
342-
English,
343342
en,
343+
Base,
344344
);
345345
mainGroup = 54DDB0B41EA1523E0009DD99;
346346
productRefGroup = 54DDB0BF1EA1523E0009DD99 /* Products */;

ApolloSQLite.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0940"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

ApolloWebSocket.xcodeproj/project.pbxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@
228228
hasScannedForEncodings = 0;
229229
knownRegions = (
230230
en,
231+
Base,
231232
);
232233
mainGroup = 720160C1206AB3D30052B2EE;
233234
productRefGroup = 720160CC206AB3D30052B2EE /* Products */;

ApolloWebSocket.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0940"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Configuration/Shared/Workspace-Language.xcconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ CLANG_MODULES_AUTOLINK = YES
1414

1515
CLANG_CXX_LANGUAGE_STANDARD = gnu++11
1616
CLANG_CXX_LIBRARY = libc++
17+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES
1718

1819
ENABLE_STRICT_OBJC_MSGSEND = YES
1920

2021
// Swift
21-
SWIFT_VERSION = 4.2
22+
SWIFT_VERSION = 5.0
2223
SWIFT_PRECOMPILE_BRIDGING_HEADER = YES
2324
SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(CONFIGURATION:upper)
2425
SWIFT_SWIFT3_OBJC_INFERENCE = Off

Sources/Apollo/Collections.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct GroupedSequence<Key: Equatable, Value> {
2424
fileprivate var groupsForKeys: [[Value]] = []
2525

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

0 commit comments

Comments
 (0)