Skip to content

Commit 1b836b0

Browse files
committed
Migrate to Swift 5
1 parent 6d571ca commit 1b836b0

File tree

11 files changed

+47
-42
lines changed

11 files changed

+47
-42
lines changed

.circleci/config.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,10 @@ step-library:
1717
run:
1818
name: Prepare
1919
command: |
20-
git submodule sync
21-
if (brew outdated | grep carthage > /dev/null); then brew upgrade carthage; fi
20+
brew unlink carthage
21+
brew install --HEAD carthage
2222
echo "foo" > ~/.mapbox
2323
24-
- &install-dependencies
25-
run:
26-
name: Install Dependencies
27-
command: |
28-
carthage bootstrap --platform ios --cache-builds --no-use-binaries
29-
carthage bootstrap --platform tvos --cache-builds --no-use-binaries
30-
carthage bootstrap --platform macos --cache-builds --no-use-binaries
31-
carthage bootstrap --platform watchos --cache-builds --no-use-binaries
32-
3324
- &publish-codecov
3425
run:
3526
name: Publish Code Coverage data
@@ -40,7 +31,6 @@ jobs:
4031
parameters:
4132
xcode:
4233
type: string
43-
default: "10.1.0"
4434
device:
4535
type: string
4636
default: "iPhone 6 Plus"
@@ -74,15 +64,31 @@ jobs:
7464
condition: << parameters.install_legacy_sim >>
7565
steps:
7666
- run: xcversion simulators --install="iOS << parameters.iOS >>"
77-
- *install-dependencies
7867
- run:
79-
name: Build and Test SDK
68+
name: iOS
8069
command: |
81-
xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections iOS' -destination 'platform=iOS Simulator,<< parameters.iOS >>,name=<< parameters.device >>' clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
82-
xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.iOS >>' clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
83-
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
70+
carthage bootstrap --platform ios --cache-builds --no-use-binaries --new-resolver
71+
xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections iOS' -destination 'platform=iOS Simulator,OS=<< parameters.iOS >>,name=<< parameters.device >>' clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
72+
- run:
73+
name: tvOS
74+
command: |
75+
carthage bootstrap --platform tvos --cache-builds --no-use-binaries --new-resolver
8476
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=<< parameters.tvOS >>' clean build <<# parameters.test >>test <</ parameters.test >> <<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
85-
- *save-cache
77+
- run:
78+
name: macOS
79+
command: |
80+
carthage bootstrap --platform macos --cache-builds --no-use-binaries --new-resolver
81+
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build<<# parameters.test >> test <</ parameters.test >><<# parameters.codecoverage >>-enableCodeCoverage YES<</ parameters.codecoverage >>
82+
- run:
83+
name: watchOS
84+
command: |
85+
carthage bootstrap --platform watchos --cache-builds --no-use-binaries --new-resolver
86+
xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build
87+
- when:
88+
condition: << parameters.codecoverage >>
89+
steps:
90+
- run: bash <(curl -s https://codecov.io/bash)
91+
- *save-cache
8692

8793
workflows:
8894
workflow:
@@ -91,12 +97,15 @@ workflows:
9197
name: "Xcode 10.2 iOS 12.2"
9298
xcode: "10.2.0"
9399
iOS: "12.2"
100+
tvOS: "12.2"
101+
watchOS: "5.2"
94102
- build-job:
95103
name: "Xcode 10.1 iOS 12.1"
96104
xcode: "10.1.0"
97105
iOS: "12.1"
106+
tvOS: "12.1"
98107
- build-job:
99-
name: "Xcode 9.4 iOS 11.2"
108+
name: "Xcode 9.4 iOS 9.3"
100109
xcode: "9.4.1"
101-
iOS: "11.4"
102-
watchOS: "4.2"
110+
iOS: "9.3"
111+
install_legacy_sim: true

Cartfile.private

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 4.4
2-
github "AliSoftware/OHHTTPStubs" ~> 7.0
2+
github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca"

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.9.0"
2-
github "AliSoftware/OHHTTPStubs" "7.0.0"
2+
github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca"
33
github "raphaelmor/Polyline" "v4.2.0"

MapboxDirections.xcodeproj/project.pbxproj

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@
10101010
attributes = {
10111011
LastSwiftMigration = 0700;
10121012
LastSwiftUpdateCheck = 0820;
1013-
LastUpgradeCheck = 1010;
1013+
LastUpgradeCheck = 1020;
10141014
ORGANIZATIONNAME = Mapbox;
10151015
TargetAttributes = {
10161016
DA1A10AE1D00F8FF009F82FA = {
@@ -1035,11 +1035,11 @@
10351035
};
10361036
DA6C9D871CAE442B00094FBC = {
10371037
CreatedOnToolsVersion = 7.3;
1038-
LastSwiftMigration = 0910;
1038+
LastSwiftMigration = 1020;
10391039
};
10401040
DA6C9D901CAE442B00094FBC = {
10411041
CreatedOnToolsVersion = 7.3;
1042-
LastSwiftMigration = 0910;
1042+
LastSwiftMigration = 1020;
10431043
};
10441044
DADD27B41E5AAAD800D31FAD = {
10451045
CreatedOnToolsVersion = 8.2.1;
@@ -1053,7 +1053,7 @@
10531053
};
10541054
buildConfigurationList = DD6254491AE70C1700017857 /* Build configuration list for PBXProject "MapboxDirections" */;
10551055
compatibilityVersion = "Xcode 3.2";
1056-
developmentRegion = English;
1056+
developmentRegion = en;
10571057
hasScannedForEncodings = 0;
10581058
knownRegions = (
10591059
en,
@@ -1774,8 +1774,7 @@
17741774
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirections;
17751775
PRODUCT_NAME = "$(TARGET_NAME)";
17761776
SKIP_INSTALL = YES;
1777-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1778-
SWIFT_VERSION = 4.0;
1777+
SWIFT_VERSION = 5.0;
17791778
VERSIONING_SYSTEM = "apple-generic";
17801779
VERSION_INFO_PREFIX = "";
17811780
};
@@ -1802,8 +1801,7 @@
18021801
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirections;
18031802
PRODUCT_NAME = "$(TARGET_NAME)";
18041803
SKIP_INSTALL = YES;
1805-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1806-
SWIFT_VERSION = 4.0;
1804+
SWIFT_VERSION = 5.0;
18071805
VERSIONING_SYSTEM = "apple-generic";
18081806
VERSION_INFO_PREFIX = "";
18091807
};
@@ -1823,8 +1821,7 @@
18231821
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS @executable_path/Frameworks @loader_path/Frameworks";
18241822
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests;
18251823
PRODUCT_NAME = "$(TARGET_NAME)";
1826-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1827-
SWIFT_VERSION = 4.0;
1824+
SWIFT_VERSION = 5.0;
18281825
};
18291826
name = Debug;
18301827
};
@@ -1841,8 +1838,7 @@
18411838
LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS @executable_path/Frameworks @loader_path/Frameworks";
18421839
PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests;
18431840
PRODUCT_NAME = "$(TARGET_NAME)";
1844-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
1845-
SWIFT_VERSION = 4.0;
1841+
SWIFT_VERSION = 5.0;
18461842
};
18471843
name = Release;
18481844
};

MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Swift).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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MapboxDirections.xcodeproj/xcshareddata/xcschemes/MapboxDirections Mac.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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MapboxDirections.xcodeproj/xcshareddata/xcschemes/MapboxDirections iOS.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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MapboxDirections.xcodeproj/xcshareddata/xcschemes/MapboxDirections tvOS.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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

MapboxDirections.xcodeproj/xcshareddata/xcschemes/MapboxDirections watchOS.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 = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)