diff --git a/.travis.yml b/.travis.yml index 11eecbc..0e7b34b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,79 @@ os: osx -language: objective-c -matrix: +language: swift +osx_image: xcode10.2 + +branches: + only: + - master +stages: + - lint + - carthage + - test +jobs: include: - - {osx_image: xcode8.3, env: 'SWFT=3.1 DST="OS=10.3.1,name=iPhone SE"'} - - {osx_image: xcode9.2, env: 'SWFT=3.2 DST="OS=11.2,name=iPhone SE"'} - - {osx_image: xcode9.4, env: 'SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'} - - {osx_image: xcode10, env: 'SWFT=3.4 DST="OS=12.0,name=iPhone SE"'} - - {osx_image: xcode9.2, env: 'SWFT=4.0 DST="OS=11.2,name=iPhone SE"'} - - {osx_image: xcode9.4, env: 'SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'} - - {osx_image: xcode10, env: 'SWFT=4.2 DST="OS=12.0,name=iPhone SE"'} -cache: - directories: - - Carthage -before_install: - - carthage bootstrap --cache-builds --no-use-binaries --platform iOS --verbose -install: - - xcodebuild -scheme PMKAddressBook -target PMKAddressBook -quiet -destination "$DST" SWIFT_VERSION=$SWFT SWIFT_TREAT_WARNINGS_AS_ERRORS=YES build - - if [[ $TEST == "1" ]]; then - xcodebuild -scheme PMKAddressBook -target PMKABTests -quiet -destination "$DST" build; - fi -script: - - if [[ $TEST == "1" ]]; then - xcodebuild -scheme PMKAddressBook -quiet -destination "$DST" test; - fi + - &pod + stage: lint + osx_image: xcode8.3 + env: SWIFT=3.1 + before_install: + gem install cocoapods --prerelease --version 1.7.0.beta.3 + install: + carthage bootstrap --no-build PromiseKit + script: | + cd Carthage/Checkouts/PromiseKit + mv .github/PromiseKit.podspec . + rm -rf Extensions/AddressBook/Sources + cp -R ../../../Sources Extensions/AddressBook + pod lib lint --subspec=PromiseKit/AddressBook --fail-fast --swift-version=$SWIFT + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=3.2 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=3.3 + - <<: *pod + osx_image: xcode10.1 + env: SWIFT=3.4 + - <<: *pod + osx_image: xcode9.2 + env: SWIFT=4.0 + - <<: *pod + osx_image: xcode9.4 + env: SWIFT=4.1 + - <<: *pod + osx_image: xcode10.1 + env: SWIFT=4.2 + # Fails at PromiseKit level currently + # - <<: *pod + # osx_image: xcode10.2 + # env: SWIFT=4.3 + # name: pod lib lint --swift-version=4.3 + - <<: *pod + osx_image: xcode10.2 + env: SWIFT=5.0 + + - &carthage + stage: carthage + osx_image: xcode9.2 + script: + carthage bootstrap + cache: + directories: + - Carthage + - <<: *carthage + osx_image: xcode9.4 + - <<: *carthage + osx_image: xcode10.1 + - <<: *carthage + osx_image: xcode10.2 + + - stage: test + xcode_scheme: PMKAddressBook + xcode_project: PMKAddressBook.xcodeproj + xcode_destination: 'platform=iOS Simulator,OS=12.2,name=iPhone SE' + cache: + directories: + - Carthage + before_install: | + carthage bootstrap --cache-builds --no-use-binaries --platform iOS + sed -i '' "s/SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;/SWIFT_TREAT_WARNINGS_AS_ERRORS = YES;/" *.xcodeproj/project.pbxproj diff --git a/Cartfile.resolved b/Cartfile.resolved index a1be206..f54bbdb 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1 +1 @@ -github "mxcl/PromiseKit" "6.3.3" +github "mxcl/PromiseKit" "6.8.4" diff --git a/PMKAddressBook.xcodeproj/project.pbxproj b/PMKAddressBook.xcodeproj/project.pbxproj index 654c352..180f4d6 100644 --- a/PMKAddressBook.xcodeproj/project.pbxproj +++ b/PMKAddressBook.xcodeproj/project.pbxproj @@ -135,27 +135,28 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0800; - LastUpgradeCheck = 1000; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Max Howell"; TargetAttributes = { 63C7FFA61D5BEE09003BAE60 = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; 63C7FFF11D5C020D003BAE60 = { CreatedOnToolsVersion = 8.0; - LastSwiftMigration = 0900; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 63C7FFA11D5BEE09003BAE60 /* Build configuration list for PBXProject "PMKAddressBook" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 63C7FF9D1D5BEE09003BAE60; productRefGroup = 63C7FFA81D5BEE09003BAE60 /* Products */; @@ -219,6 +220,7 @@ baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -273,7 +275,7 @@ SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -287,6 +289,7 @@ baseConfigurationReference = 63BF28101D5C257100F62C66 /* Carthage.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -333,7 +336,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.Foundation; SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2,3,4"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; @@ -358,6 +361,7 @@ PRODUCT_MODULE_NAME = "${TARGET_NAME}"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Debug; }; @@ -375,6 +379,7 @@ PRODUCT_BUNDLE_IDENTIFIER = org.promisekit.AddressBook; PRODUCT_MODULE_NAME = "${TARGET_NAME}"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; }; name = Release; }; @@ -387,7 +392,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SUPPRESS_WARNINGS = YES; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -399,7 +403,6 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SUPPRESS_WARNINGS = YES; - SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme b/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme index eaee6b6..48de426 100644 --- a/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme +++ b/PMKAddressBook.xcodeproj/xcshareddata/xcschemes/PMKAddressBook.xcscheme @@ -1,6 +1,6 @@ Promise { throw AddressBookError.denied case .authorized: fatalError("This should not happen") + #if swift(>=4.3) + @unknown default: + print("warning: PromiseKit: unknown case statement, please PR a fix!") + throw AddressBookError.denied + #endif } }