瀏覽代碼

Test with Xcode 10.0 on CI

Kishikawa Katsumi 6 年之前
父節點
當前提交
c5d4bbadd0
共有 2 個文件被更改,包括 53 次插入7 次删除
  1. 11 0
      .travis.yml
  2. 42 7
      Lib/Rakefile

+ 11 - 0
.travis.yml

@@ -11,6 +11,17 @@ script:
 - "(cd Lib && travis_retry bundle exec rake $ACTION)"
 - "(cd Lib && travis_retry bundle exec rake $ACTION)"
 matrix:
 matrix:
   include:
   include:
+  - osx_image: xcode10
+    env: ACTION=build
+  - osx_image: xcode10
+    env: ACTION='build:carthage'
+  - osx_image: xcode10
+    env: ACTION='test:iphonesimulator'
+  - osx_image: xcode10
+    env: ACTION='test:appletvsimulator'
+  - osx_image: xcode10
+    env: ACTION='test:macosx'
+
   - osx_image: xcode9.4
   - osx_image: xcode9.4
     env: ACTION=build
     env: ACTION=build
   - osx_image: xcode9.4
   - osx_image: xcode9.4

+ 42 - 7
Lib/Rakefile

@@ -7,7 +7,16 @@ end
 
 
 def destinations(platform: 'iphonesimulator')
 def destinations(platform: 'iphonesimulator')
   if platform == 'iphonesimulator'
   if platform == 'iphonesimulator'
-    if xcode_version.start_with?('9.4')
+    if xcode_version.start_with?('10')
+      [ 'name=iPhone 5s,OS=12.0',
+        'name=iPhone 6,OS=12.0',
+        'name=iPhone 6s Plus,OS=12.0',
+        'name=iPhone SE,OS=12.0',
+        'name=iPad Air 2,OS=12.0',
+        'name=iPad Pro (9.7-inch),OS=12.0',
+        'name=iPad Pro (12.9-inch),OS=12.0'
+      ]
+    elsif xcode_version.start_with?('9.4')
       [ 'name=iPhone 5s,OS=11.4',
       [ 'name=iPhone 5s,OS=11.4',
         'name=iPhone 6,OS=11.4',
         'name=iPhone 6,OS=11.4',
         'name=iPhone 6s Plus,OS=11.4',
         'name=iPhone 6s Plus,OS=11.4',
@@ -70,7 +79,11 @@ def destinations(platform: 'iphonesimulator')
       ]
       ]
     end
     end
   elsif platform == 'watchsimulator'
   elsif platform == 'watchsimulator'
-    if xcode_version.start_with?('9.4')
+    if xcode_version.start_with?('10')
+      [ 'name=Apple Watch Series 4 - 40mm,OS=5.0',
+        'name=Apple Watch Series 4 - 44mm,OS=5.0'
+      ]
+    elsif xcode_version.start_with?('9.4')
       [ 'name=Apple Watch Series 3 - 38mm,OS=4.3',
       [ 'name=Apple Watch Series 3 - 38mm,OS=4.3',
         'name=Apple Watch Series 3 - 42mm,OS=4.3'
         'name=Apple Watch Series 3 - 42mm,OS=4.3'
       ]
       ]
@@ -100,7 +113,10 @@ def destinations(platform: 'iphonesimulator')
       ]
       ]
     end
     end
   elsif platform == 'appletvsimulator'
   elsif platform == 'appletvsimulator'
-    if xcode_version.start_with?('9.4')
+    if xcode_version.start_with?('10')
+      [ 'name=Apple TV 4K,OS=12.0'
+      ]
+    elsif xcode_version.start_with?('9.4')
       [ 'name=Apple TV 4K,OS=11.4'
       [ 'name=Apple TV 4K,OS=11.4'
       ]
       ]
     elsif xcode_version.start_with?('9.3')
     elsif xcode_version.start_with?('9.3')
@@ -157,7 +173,16 @@ namespace :build do
         t.add_build_setting('CODE_SIGN_IDENTITY', '')
         t.add_build_setting('CODE_SIGN_IDENTITY', '')
         t.add_build_setting('CODE_SIGNING_REQUIRED', 'NO')
         t.add_build_setting('CODE_SIGNING_REQUIRED', 'NO')
       end
       end
-      if xcode_version.start_with?('9.4')
+      if xcode_version.start_with?('10')
+        t.add_build_setting('SWIFT_VERSION', '4.2')
+        if platform == 'iphonesimulator'
+          t.add_destination('name=iPhone 7,OS=12.0')
+        elsif platform == 'watchsimulator'
+          t.add_destination('name=Apple Watch Series 4 - 44mm,OS=5.0')
+        elsif platform == 'appletvsimulator'
+          t.add_destination('name=Apple TV 4K,OS=12.0')
+        end
+      elsif xcode_version.start_with?('9.4')
         t.add_build_setting('SWIFT_VERSION', '4.1')
         t.add_build_setting('SWIFT_VERSION', '4.1')
         if platform == 'iphonesimulator'
         if platform == 'iphonesimulator'
           t.add_destination('name=iPhone 7,OS=11.4')
           t.add_destination('name=iPhone 7,OS=11.4')
@@ -217,11 +242,21 @@ namespace :build do
 
 
   task :carthage do
   task :carthage do
     sh %[echo 'github \"kishikawakatsumi/KeychainAccess\"' > Cartfile]
     sh %[echo 'github \"kishikawakatsumi/KeychainAccess\"' > Cartfile]
-    if xcode_version.start_with?('8')
+    if xcode_version.start_with?('10')
+      sh %[echo SWIFT_VERSION=\"4.2\" > swift42.xcconfig]
+      sh %[XCODE_XCCONFIG_FILE=`pwd`/swift42.xcconfig carthage update --no-use-binaries]
+    elsif xcode_version.start_with?('9.4')
+      sh %[echo SWIFT_VERSION=\"4.1\" > swift41.xcconfig]
+      sh %[XCODE_XCCONFIG_FILE=`pwd`/swift41.xcconfig carthage update --no-use-binaries]
+    elsif xcode_version.start_with?('9.3')
+      sh %[echo SWIFT_VERSION=\"4.1\" > swift41.xcconfig]
+      sh %[XCODE_XCCONFIG_FILE=`pwd`/swift41.xcconfig carthage update --no-use-binaries]
+    elsif xcode_version.start_with?('9')
+      sh %[echo SWIFT_VERSION=\"4.0\" > swift40.xcconfig]
+      sh %[XCODE_XCCONFIG_FILE=`pwd`/swift40.xcconfig carthage update --no-use-binaries]
+    else
       sh %[echo SWIFT_VERSION=\"3.0\" > swift3.xcconfig]
       sh %[echo SWIFT_VERSION=\"3.0\" > swift3.xcconfig]
       sh %[XCODE_XCCONFIG_FILE=`pwd`/swift3.xcconfig carthage update --no-use-binaries]
       sh %[XCODE_XCCONFIG_FILE=`pwd`/swift3.xcconfig carthage update --no-use-binaries]
-    else
-      sh %[carthage update --no-use-binaries]
     end
     end
   end
   end
 end
 end