From bbf945fbfa7277f1dbfb4b6bc416754f11fdb507 Mon Sep 17 00:00:00 2001 From: Christian Tietze Date: Thu, 25 Apr 2019 21:27:05 +0200 Subject: [PATCH] Swift 5 Migration (#74) * update project settings * migrate to Swift 5 * add Swift 5 targets to travis * add tvOS 3 to targeted device families * use latest CocoaPods to support #swift_versions * fix failing tests (unsorted dictionary keys) --- .travis.yml | 21 ++++--- SwiftCSV.xcodeproj/project.pbxproj | 55 ++++++++++--------- .../xcschemes/SwiftCSV-iOS.xcscheme | 2 +- .../xcschemes/SwiftCSV-macOS.xcscheme | 2 +- .../xcschemes/SwiftCSV-tvOS.xcscheme | 2 +- .../xcschemes/SwiftCSV-watchOS.xcscheme | 2 +- SwiftCSVTests/CSVTests.swift | 2 +- SwiftCSVTests/TSVTests.swift | 2 +- 8 files changed, 46 insertions(+), 42 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1aad494..d13a731 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ branches: - gh-pages install: + - gem install cocoapods --pre -N - gem install xcpretty -N env: @@ -21,20 +22,18 @@ matrix: env: SCHEME="macOS" SDK="macosx10.13" DESTINATION="arch=x86_64" SWIFT_VERSION="4.1" ACTION="test" - osx_image: xcode10.1 env: SCHEME="macOS" SDK="macosx10.14" DESTINATION="arch=x86_64" SWIFT_VERSION="4.2" ACTION="test" - - osx_image: xcode10.1 - env: SCHEME="iOS" SDK="iphonesimulator" DESTINATION="OS=12.0,name=iPhone 8" SWIFT_VERSION="4.2" ACTION="test" - - osx_image: xcode10.1 - env: SCHEME="watchOS" SDK="watchsimulator" DESTINATION="OS=4.0,name=Apple Watch - 42mm" SWIFT_VERSION="4.2" ACTION="build" - - osx_image: xcode10.1 - env: SCHEME="tvOS" SDK="appletvsimulator" DESTINATION="OS=12.0,name=Apple TV 4K" SWIFT_VERSION="4.2" ACTION="test" - -script: - - xcodebuild -project SwiftCSV.xcodeproj -scheme "SwiftCSV" -sdk iphonesimulator - -destination "platform=iOS Simulator,name=iPhone 6" ONLY_ACTIVE_ARCH=NO test | xcpretty -c - + - osx_image: xcode10.2 + env: SCHEME="macOS" SDK="macosx10.14" DESTINATION="arch=x86_64" SWIFT_VERSION="5.0" ACTION="test" + - osx_image: xcode10.2 + env: SCHEME="iOS" SDK="iphonesimulator" DESTINATION="OS=12.0,name=iPhone 8" SWIFT_VERSION="5.0" ACTION="test" + - osx_image: xcode10.2 + env: SCHEME="watchOS" SDK="watchsimulator" DESTINATION="OS=4.0,name=Apple Watch - 42mm" SWIFT_VERSION="5.0" ACTION="build" + - osx_image: xcode10.2 + env: SCHEME="tvOS" SDK="appletvsimulator" DESTINATION="OS=12.0,name=Apple TV 4K" SWIFT_VERSION="5.0" ACTION="test" script: - set -o pipefail + - pod --version - xcodebuild -version - xcodebuild -showsdks - xcodebuild diff --git a/SwiftCSV.xcodeproj/project.pbxproj b/SwiftCSV.xcodeproj/project.pbxproj index 3a8eadd..2a5439a 100644 --- a/SwiftCSV.xcodeproj/project.pbxproj +++ b/SwiftCSV.xcodeproj/project.pbxproj @@ -418,48 +418,49 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Naoto Kaneko"; TargetAttributes = { 3D1E59B31945FFAC001CF760 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; 3D1E59BE1945FFAD001CF760 = { CreatedOnToolsVersion = 6.0; DevelopmentTeam = 2X7R4W3Y3Q; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; TestTargetID = 3D1E59B31945FFAC001CF760; }; 5FB74B901CCB9274009DDBF1 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; }; 5FB74B991CCB9274009DDBF1 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; }; 5FB74BAC1CCB929D009DDBF1 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; }; 5FB74BB51CCB929D009DDBF1 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; }; 5FB74BC81CCB92BA009DDBF1 = { CreatedOnToolsVersion = 7.3; - LastSwiftMigration = 0940; + LastSwiftMigration = 1020; }; }; }; buildConfigurationList = 3D1E59AE1945FFAC001CF760 /* Build configuration list for PBXProject "SwiftCSV" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = 3D1E59AA1945FFAC001CF760; productRefGroup = 3D1E59B51945FFAC001CF760 /* Products */; @@ -668,6 +669,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -726,6 +728,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -789,7 +792,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -808,7 +811,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -829,7 +832,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -845,7 +848,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -871,7 +874,7 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -898,7 +901,7 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = macosx; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -917,7 +920,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.SwiftCSV.SwiftCSV-OSXTests"; PRODUCT_NAME = SwiftCSVTests; SDKROOT = macosx; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -937,7 +940,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.SwiftCSV.SwiftCSV-OSXTests"; PRODUCT_NAME = SwiftCSVTests; SDKROOT = macosx; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -960,8 +963,8 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = 3; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Debug; @@ -986,8 +989,8 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = appletvos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = 3; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Release; @@ -1004,7 +1007,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.SwiftCSV.SwiftCSV-tvOSTests"; PRODUCT_NAME = SwiftCSVTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Debug; @@ -1022,7 +1026,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "naoty.SwiftCSV.SwiftCSV-tvOSTests"; PRODUCT_NAME = SwiftCSVTests; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,3"; TVOS_DEPLOYMENT_TARGET = 9.2; }; name = Release; @@ -1047,7 +1052,7 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.2; }; @@ -1074,7 +1079,7 @@ PRODUCT_NAME = SwiftCSV; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; WATCHOS_DEPLOYMENT_TARGET = 2.2; }; diff --git a/SwiftCSV.xcodeproj/xcshareddata/xcschemes/SwiftCSV-iOS.xcscheme b/SwiftCSV.xcodeproj/xcshareddata/xcschemes/SwiftCSV-iOS.xcscheme index 7330415..e94f887 100644 --- a/SwiftCSV.xcodeproj/xcshareddata/xcschemes/SwiftCSV-iOS.xcscheme +++ b/SwiftCSV.xcodeproj/xcshareddata/xcschemes/SwiftCSV-iOS.xcscheme @@ -1,6 +1,6 @@