diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2b0223f --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,108 @@ +version: 2.1 + +step-library: + - &restore-cache + restore_cache: + keys: + - cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + - cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }} # used if checksum fails + + - &save-cache + save_cache: + key: cache-mbgeocoder-v1-{{ .Environment.CIRCLE_JOB }}-{{ checksum "Cartfile.resolved" }} + paths: + - Carthage + + - &prepare + run: + name: Prepare + command: | + curl -L https://github.com/Carthage/Carthage/releases/download/0.33.0/Carthage.pkg >> Carthage.pkg + sudo installer -pkg Carthage.pkg -target / + 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 + - 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 + - *restore-cache + - 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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 MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder Mac' clean build<<# parameters.test >> test <><<# parameters.codecoverage >>-enableCodeCoverage YES<> + - run: + name: watchOS + command: xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder 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_iOS_12" + xcode: "10.2.0" + iOS: "12.2" + tvOS: "12.2" + watchOS: "5.2" + codecoverage: true + - build-job: + name: "Xcode_10.2_iOS_9" + xcode: "10.2.0" + iOS: "9.3" + tvOS: "12.2" + watchOS: "5.2" diff --git a/Cartfile.private b/Cartfile.private index 2470034..5a2eb12 100644 --- a/Cartfile.private +++ b/Cartfile.private @@ -1,2 +1,2 @@ binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" ~> 4.0 -github "AliSoftware/OHHTTPStubs" ~> 6.0 +github "frederoni/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" diff --git a/Cartfile.resolved b/Cartfile.resolved index 0ba81a8..203cf15 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.6.0" -github "AliSoftware/OHHTTPStubs" "6.1.0" +binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "4.10.0" +github "frederoni/OHHTTPStubs" "563f48d3fab84ef04639649c770b00f4fa502cca" diff --git a/MapboxGeocoder.xcodeproj/project.pbxproj b/MapboxGeocoder.xcodeproj/project.pbxproj index a316c66..27316a6 100644 --- a/MapboxGeocoder.xcodeproj/project.pbxproj +++ b/MapboxGeocoder.xcodeproj/project.pbxproj @@ -729,36 +729,36 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = Mapbox; TargetAttributes = { DA5170951CF1B18F00CD6DCF = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0910; + LastSwiftMigration = 1020; }; DA51709E1CF1B18F00CD6DCF = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0920; + LastSwiftMigration = 1020; }; DA5170C01CF253EE00CD6DCF = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0910; + LastSwiftMigration = 1020; }; DA5170C91CF253EE00CD6DCF = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0920; + LastSwiftMigration = 1020; }; DA5170EA1CF2581900CD6DCF = { CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 0800; + LastSwiftMigration = 1020; }; DD342B4F19A140EE00219F77 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; DDC2470319A1C3B40054B0C0 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; DDC2472919A1C60E0054B0C0 = { CreatedOnToolsVersion = 6.0; @@ -766,13 +766,13 @@ }; DDF1E8491BD6F7BA00C40C78 = { CreatedOnToolsVersion = 7.0.1; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = DD342B4B19A140EE00219F77 /* Build configuration list for PBXProject "MapboxGeocoder" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -1155,7 +1155,6 @@ PRODUCT_NAME = MapboxGeocoder; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1188,7 +1187,6 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1213,7 +1211,6 @@ PRODUCT_NAME = MapboxGeocoderTests; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; name = Debug; }; @@ -1237,7 +1234,6 @@ PRODUCT_NAME = MapboxGeocoderTests; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; name = Release; }; @@ -1264,7 +1260,6 @@ PRODUCT_NAME = MapboxGeocoder; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1297,7 +1292,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1322,7 +1316,7 @@ PRODUCT_NAME = MapboxGeocoderTests; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -1345,7 +1339,7 @@ PRODUCT_NAME = MapboxGeocoderTests; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; @@ -1411,6 +1405,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1470,6 +1465,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; BITCODE_GENERATION_MODE = bitcode; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1531,7 +1527,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Geocoder.Swift; PRODUCT_NAME = "Geocoder (Swift)"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1550,7 +1545,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Geocoder.Swift; PRODUCT_NAME = "Geocoder (Swift)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -1575,6 +1569,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2,3"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1597,6 +1592,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2,3"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1651,6 +1647,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGeocoderTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Debug; }; @@ -1670,6 +1667,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGeocoderTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2,3"; }; name = Release; }; diff --git a/MapboxGeocoder.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme b/MapboxGeocoder.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme index ce90991..5cb31ad 100644 --- a/MapboxGeocoder.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme +++ b/MapboxGeocoder.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-MapboxGeocoder-ios-11 - run: - name: Build and Test MapboxGeocoder for iOS 11 - command: | - xcodebuild -sdk iphonesimulator -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder iOS' -destination 'platform=iOS Simulator,OS=11.4,name=iPhone 6 Plus' clean build test - - - &build-test-MapboxGeocoder-ios-12 - run: - name: Build and Test MapboxGeocoder for iOS 12 - command: | - xcodebuild -sdk iphonesimulator -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder iOS' -destination 'platform=iOS Simulator,OS=12.0,name=iPhone 6 Plus' clean build test - - - &build-MapboxGeocoder-watchos-4 - run: - name: Build MapboxGeocoder for watchOS 4 - command: | - xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=4.2' clean build - - - &build-MapboxGeocoder-watchos-5 - run: - name: Build MapboxGeocoder for watchOS 5 - command: | - xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder watchOS' -destination 'platform=watchOS Simulator,name=Apple Watch Series 3 - 42mm,OS=5.0' clean build - - - &build-test-MapboxGeocoder-tvos-12 - run: - name: Build and Test MapboxGeocoder for tvOS 12 - command: | - xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder tvOS' -destination 'platform=tvOS Simulator,name=Apple TV 4K (at 1080p),OS=12.0' clean build test - - - &build-test-MapboxGeocoder-macos - run: - name: Build and Test MapboxGeocoder for macOS - command: | - xcodebuild -project MapboxGeocoder.xcodeproj -scheme 'MapboxGeocoder Mac' clean build test | xcpretty - -jobs: - xcode-10: - macos: - xcode: "10.0.0" - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxGeocoder-ios-12 - - *build-MapboxGeocoder-watchos-5 - - *build-test-MapboxGeocoder-tvos-12 - - *build-test-MapboxGeocoder-macos - - *save-cache - - xcode-9: - macos: - xcode: "9.4.1" - environment: - HOMEBREW_NO_AUTO_UPDATE: 1 - steps: - - checkout - - *prepare - - *restore-cache - - *install-dependencies - - *build-test-MapboxGeocoder-ios-11 - - *build-MapboxGeocoder-watchos-4 - - *build-test-MapboxGeocoder-macos - - *save-cache diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..a545526 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,9 @@ +ignore: + - "Geocoder Example" + - "MapboxGeocoderTests" + +coverage: + status: + project: + default: + threshold: 1%