diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..5eb0bf329 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,113 @@ +version: 2.1 + +step-library: + - &restore-cache + restore_cache: + keys: + - carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + - carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }} # used if checksum fails + + - &save-cache + save_cache: + key: carthage-cache-mbdirections-v3-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + paths: + - Carthage + + - &prepare + run: + name: Prepare + command: | + if [ $(carthage outdated | grep -cF "latest Carthage version") -eq 0 ]; then brew update && brew upgrade carthage || true; fi + echo "foo" > ~/.mapbox + + - &publish-codecov + run: + name: Publish code coverage + command: bash <(curl -s https://codecov.io/bash) + +jobs: + build-job: + parameters: + xcode: + type: string + device: + type: string + default: "iPhone 6 Plus" + iOS: + type: string + default: "12.1" + watchOS: + type: string + default: "5.0" + tvOS: + type: string + default: "12.0" + test: + type: boolean + default: true + codecoverage: + type: boolean + default: false + macos: + xcode: << parameters.xcode >> + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - *prepare + - *restore-cache + - run: + name: Install prerequisites + command: | + if [ $(xcversion simulators | grep -cF "iOS << parameters.iOS >> Simulator (installed)") -eq 0 ]; then xcversion simulators --install="iOS << parameters.iOS >>" || true; fi + - run: + name: Dependencies + command: | + carthage bootstrap --platform ios --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform tvos --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform macos --cache-builds --configuration Debug --no-use-binaries + carthage bootstrap --platform watchos --cache-builds --configuration Debug --no-use-binaries + - *save-cache + - run: + name: iOS + command: 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.codecoverage >> -enableCodeCoverage "YES"<> + - when: + condition: << parameters.codecoverage >> + steps: + - *publish-codecov + - run: + name: tvOS + command: 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.codecoverage >>-enableCodeCoverage YES<> + - when: + condition: << parameters.codecoverage >> + steps: + - *publish-codecov + - run: + name: macOS + command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build<<# parameters.test >> test <><<# parameters.codecoverage >>-enableCodeCoverage YES<> + - run: + name: watchOS + command: xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=<< parameters.watchOS >>' clean build + +workflows: + workflow: + jobs: + - build-job: + name: "Xcode_10.2" + xcode: "10.2.0" + iOS: "12.2" + tvOS: "12.2" + watchOS: "5.2" + - build-job: + name: "Xcode_10.0" + xcode: "10.0.0" + iOS: "12.0" + tvOS: "12.0" + codecoverage: true + - build-job: + name: "Xcode_9.4" + xcode: "9.4.1" + iOS: "9.3" + tvOS: "11.4" + watchOS: "4.3" + test: false diff --git a/CHANGELOG.md b/CHANGELOG.md index e58bf9242..d05957b25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changes to MapboxDirections.swift +## master + +* Fixed compatibility issues with Xcode 10.2 when the SDK is installed using Carthage. ([#363](https://github.com/mapbox/MapboxDirections.swift/pull/363)) + ## v0.27.2 * Fixed an issue where `Waypoint.separatesLegs` caused the resulting `RouteLeg.source` and `RouteLeg.destination` to have mismatched coordinates and names. ([#358](https://github.com/mapbox/MapboxDirections.swift/pull/358)) diff --git a/Cartfile.private b/Cartfile.private index 7cbc27760..560328426 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,2 @@ binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 4.4 -github "AliSoftware/OHHTTPStubs" ~> 6.0 +github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" diff --git a/Cartfile.resolved b/Cartfile.resolved index 413cc0a8d..cc81c65f2 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,3 +1,3 @@ -binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.8.0" -github "AliSoftware/OHHTTPStubs" "6.1.0" +binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.9.0" +github "linksmt/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" github "raphaelmor/Polyline" "v4.2.0" diff --git a/MapboxDirections.xcodeproj/project.pbxproj b/MapboxDirections.xcodeproj/project.pbxproj index 89a44a7cb..e3b16010c 100644 --- a/MapboxDirections.xcodeproj/project.pbxproj +++ b/MapboxDirections.xcodeproj/project.pbxproj @@ -1010,7 +1010,7 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Mapbox; TargetAttributes = { DA1A10AE1D00F8FF009F82FA = { @@ -1035,11 +1035,11 @@ }; DA6C9D871CAE442B00094FBC = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0910; + LastSwiftMigration = 1020; }; DA6C9D901CAE442B00094FBC = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0910; + LastSwiftMigration = 1020; }; DADD27B41E5AAAD800D31FAD = { CreatedOnToolsVersion = 8.2.1; @@ -1053,7 +1053,7 @@ }; buildConfigurationList = DD6254491AE70C1700017857 /* Build configuration list for PBXProject "MapboxDirections" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -1515,7 +1515,6 @@ PRODUCT_NAME = MapboxDirections; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1544,7 +1543,6 @@ PRODUCT_NAME = MapboxDirections; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1566,7 +1564,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests; PRODUCT_NAME = MapboxDirectionsTests; SDKROOT = macosx; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1585,7 +1582,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests; PRODUCT_NAME = MapboxDirectionsTests; SDKROOT = macosx; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -1612,7 +1608,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1642,7 +1637,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1665,7 +1659,6 @@ PRODUCT_NAME = MapboxDirectionsTests; SDKROOT = appletvos; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -1684,7 +1677,6 @@ PRODUCT_NAME = MapboxDirectionsTests; SDKROOT = appletvos; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; @@ -1713,7 +1705,6 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1744,7 +1735,6 @@ SDKROOT = watchos; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 4; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1775,7 +1765,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1803,7 +1792,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1823,8 +1811,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1841,8 +1827,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) $(PROJECT_DIR)/Carthage/Build/iOS @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxDirectionsTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme b/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme index f9ae19b9c..f525f3e02 100644 --- a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme +++ b/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme @@ -1,6 +1,6 @@ /dev/null); then brew upgrade carthage; fi - echo "foo" > ~/.mapbox - - - &install-dependencies - run: - name: Install Dependencies - command: | - carthage bootstrap --platform ios --cache-builds --no-use-binaries - carthage bootstrap --platform tvos --cache-builds --no-use-binaries - carthage bootstrap --platform macos --cache-builds --no-use-binaries - carthage bootstrap --platform watchos --cache-builds --no-use-binaries - - - &build-test-MapboxDirections-ios-11 - run: - name: Build and Test MapboxDirections for iOS 11 - command: | - xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections iOS' -destination 'platform=iOS Simulator,OS=11.4,name=iPhone 6 Plus' clean build test -enableCodeCoverage "YES" - - - &build-test-MapboxDirections-ios-12 - run: - name: Build and Test MapboxDirections for iOS 12 - command: | - xcodebuild -sdk iphonesimulator -project MapboxDirections.xcodeproj -scheme 'MapboxDirections iOS' -destination 'platform=iOS Simulator,OS=12.0,name=iPhone 6 Plus' clean build test -enableCodeCoverage "YES" - - - &build-MapboxDirections-watchos-4 - run: - name: Build MapboxDirections for watchOS 4 - command: | - xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=4.2' clean build - - - &build-MapboxDirections-watchos-5 - run: - name: Build MapboxDirections for watchOS 5 - command: | - xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=5.0' clean build - - - &build-test-MapboxDirections-tvos-12 - run: - name: Build and Test MapboxDirections for tvOS 12 - command: | - xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=12.0' clean build test -enableCodeCoverage "YES" - - - &build-test-MapboxDirections-macos - run: - name: Build and Test MapboxDirections for macOS - command: | - xcodebuild -project MapboxDirections.xcodeproj -scheme 'MapboxDirections Mac' clean build test -enableCodeCoverage "YES" | xcpretty - - - &publish-codecov - run: - name: Publish Code Coverage data - command: bash <(curl -s https://codecov.io/bash) - -jobs: - xcode-10: - macos: - xcode: "10.0.0" - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxDirections-ios-12 - - *build-MapboxDirections-watchos-5 - - *build-test-MapboxDirections-tvos-12 - - *build-test-MapboxDirections-macos - - *publish-codecov - - *save-cache - - xcode-9: - macos: - xcode: "9.4.1" - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxDirections-ios-11 - - *build-MapboxDirections-watchos-4 - - *build-test-MapboxDirections-macos - - *save-cache