Skip to content

Commit c4b84a7

Browse files
authored
Merge pull request swiftlang#293 from xedin/support-full-swift-version-for-4
Fix builder factory to handle Swift version 4.2 correctly
2 parents c7e91c1 + 64930e4 commit c4b84a7

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

project_future.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,19 @@ def dispatch(root_path, repo, action, swiftc, swift_version,
303303

304304
other_swift_flags = []
305305
if swift_version:
306-
other_swift_flags += ['-swift-version', swift_version.split('.')[0]]
307-
initial_xcodebuild_flags += ['SWIFT_VERSION=%s' % swift_version.split('.')[0]]
306+
if '.' not in swift_version:
307+
swift_version += '.0'
308+
309+
major, minor = swift_version.split('.', 1)
310+
# Need to use float for minor version parsing
311+
# because it's possible that it would be specified
312+
# as e.g. `4.0.3`
313+
if int(major) == 4 and float(minor) == 2.0:
314+
other_swift_flags += ['-swift-version', swift_version]
315+
initial_xcodebuild_flags += ['SWIFT_VERSION=%s' % swift_version]
316+
else:
317+
other_swift_flags += ['-swift-version', major]
318+
initial_xcodebuild_flags += ['SWIFT_VERSION=%s' % major]
308319
if added_swift_flags:
309320
other_swift_flags.append(added_swift_flags)
310321
if other_swift_flags:
@@ -982,7 +993,7 @@ def dispatch(self, identifier, stdout=sys.stdout, stderr=sys.stderr):
982993
return None
983994

984995
if not self.swift_version:
985-
self.swift_version = self.version['version'].split('.')[0]
996+
self.swift_version = self.version['version']
986997
try:
987998
dispatch(self.root_path, self.project, self.action,
988999
self.swiftc,

projects.json

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"maintainer": "[email protected]",
3434
"compatibility": [
3535
{
36-
"version": "4.2",
36+
"version": "4.0",
3737
"commit": "a5cd9e233f24df3583f4b02f7e4722c076ab9032"
3838
}
3939
],
@@ -576,7 +576,7 @@
576576
"maintainer": "[email protected]",
577577
"compatibility": [
578578
{
579-
"version": "4.2",
579+
"version": "4.0",
580580
"commit": "ce0d2450b83ec8c5dee6bb9c612b3eb06ba39c47"
581581
}
582582
],
@@ -950,7 +950,7 @@
950950
"maintainer": "[email protected]",
951951
"compatibility": [
952952
{
953-
"version": "4.2",
953+
"version": "4.0",
954954
"commit": "8988b02ab963294d98d8f37d1a7dc0ee392fcd8d"
955955
}
956956
],
@@ -1663,18 +1663,7 @@
16631663
"target": "ProcedureKitCloud",
16641664
"destination": "platform=macOS",
16651665
"configuration": "Release",
1666-
"tags": "sourcekit",
1667-
"xfail": {
1668-
"compatibility": {
1669-
"4.2": {
1670-
"branch": {
1671-
"master": "https://bugs.swift.org/browse/SR-9139",
1672-
"swift-5.0-branch": "https://bugs.swift.org/browse/SR-9139",
1673-
"swift-4.2-branch": "https://bugs.swift.org/browse/SR-9139"
1674-
}
1675-
}
1676-
}
1677-
}
1666+
"tags": "sourcekit"
16781667
},
16791668
{
16801669
"action": "TestXcodeProjectTarget",
@@ -2830,7 +2819,7 @@
28302819
"maintainer": "[email protected]",
28312820
"compatibility": [
28322821
{
2833-
"version": "4.2",
2822+
"version": "4.0",
28342823
"commit": "f168b4fd2757cbda7092c3db8685dc2854b80003"
28352824
}
28362825
],

0 commit comments

Comments
 (0)