@@ -20,6 +20,8 @@ def create_app_project
2020 super . tap do
2121 project = Xcodeproj ::Project . open ( validation_dir + "#{ APP_TARGET } .xcodeproj" )
2222 create_test_target ( project )
23+ set_swift_version ( project , '2.3' )
24+ project . save
2325 end
2426 end
2527
@@ -45,6 +47,14 @@ def build_pod
4547 end
4648
4749 private
50+ def set_swift_version ( project , version )
51+ project . targets . each do |target |
52+ target . build_configuration_list . build_configurations . each do |configuration |
53+ configuration . build_settings [ 'SWIFT_VERSION' ] = version
54+ end
55+ end
56+ end
57+
4858 def create_test_target ( project )
4959 test_target = project . new_target ( :unit_test_bundle , TEST_TARGET , consumer . platform_name , deployment_target )
5060 group = project . new_group ( TEST_TARGET )
@@ -71,7 +81,12 @@ def add_test_target(pod_file)
7181 end
7282
7383 def run_tests
74- command = %W( clean test -workspace #{ APP_TARGET } .xcworkspace -scheme #{ TEST_TARGET } -configuration Debug )
84+ command = [
85+ 'clean' , 'test' ,
86+ '-workspace' , File . join ( validation_dir , "#{ APP_TARGET } .xcworkspace" ) ,
87+ '-scheme' , TEST_TARGET ,
88+ '-configuration' , 'Debug'
89+ ]
7590 case consumer . platform_name
7691 when :ios
7792 command += %w( CODE_SIGN_IDENTITY=- -sdk iphonesimulator )
0 commit comments