Skip to content

Commit d7c0306

Browse files
committed
Set Swift version to 2.3
1 parent f128b16 commit d7c0306

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CocoaPodsTests/test_running_validator.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)

SQLite.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,7 @@
969969
SKIP_INSTALL = YES;
970970
"SWIFT_INCLUDE_PATHS[sdk=appletvos*]" = "$(SRCROOT)/CocoaPods/appletvos";
971971
"SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]" = "$(SRCROOT)/CocoaPods/appletvsimulator";
972+
SWIFT_VERSION = 2.3;
972973
TVOS_DEPLOYMENT_TARGET = 9.1;
973974
};
974975
name = Debug;
@@ -989,6 +990,7 @@
989990
SKIP_INSTALL = YES;
990991
"SWIFT_INCLUDE_PATHS[sdk=appletvos*]" = "$(SRCROOT)/CocoaPods/appletvos";
991992
"SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]" = "$(SRCROOT)/CocoaPods/appletvsimulator";
993+
SWIFT_VERSION = 2.3;
992994
TVOS_DEPLOYMENT_TARGET = 9.1;
993995
};
994996
name = Release;

0 commit comments

Comments
 (0)