Skip to content

Commit 0aaf650

Browse files
committed
Set Swift version to 2.3
1 parent 1cc0a53 commit 0aaf650

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
@@ -970,6 +970,7 @@
970970
SKIP_INSTALL = YES;
971971
"SWIFT_INCLUDE_PATHS[sdk=appletvos*]" = "$(SRCROOT)/CocoaPods/appletvos";
972972
"SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]" = "$(SRCROOT)/CocoaPods/appletvsimulator";
973+
SWIFT_VERSION = 2.3;
973974
TVOS_DEPLOYMENT_TARGET = 9.1;
974975
};
975976
name = Debug;
@@ -991,6 +992,7 @@
991992
SKIP_INSTALL = YES;
992993
"SWIFT_INCLUDE_PATHS[sdk=appletvos*]" = "$(SRCROOT)/CocoaPods/appletvos";
993994
"SWIFT_INCLUDE_PATHS[sdk=appletvsimulator*]" = "$(SRCROOT)/CocoaPods/appletvsimulator";
995+
SWIFT_VERSION = 2.3;
994996
TVOS_DEPLOYMENT_TARGET = 9.1;
995997
};
996998
name = Release;

0 commit comments

Comments
 (0)