@@ -53,15 +53,15 @@ from swift_build_support.swift_build_support.toolchain import host_toolchain
53
53
# TODO: Remove this constant, it's really not helpful.
54
54
HOME = os .environ .get ("HOME" , "/" )
55
55
56
- _SUPPORTED_XCODE_BUILDS = (
57
- "12A8169g " , # 12.0b3
58
- "12A8179i " , # 12.0b4
59
- "12A8189h " , # 12.0b5
60
- "12A8189n " , # 12.0b6
61
- "12A7208 " , # 12.0GM1
62
- "12A7209 " , # 12.0GM2
63
- "12A7300" , # 12.0.1
64
- )
56
+ _SUPPORTED_XCODE_BUILDS = [
57
+ ( "12.0 beta 3 " , "12A8169g" ),
58
+ ( "12.0 beta 4 " , "12A8179i" ),
59
+ ( "12.0 beta 5 " , "12A8189h" ),
60
+ ( "12.0 beta 6 " , "12A8189n" ),
61
+ ( "12.0 GM 1 " , "12A7208" ),
62
+ ( "12.0 GM 2 " , "12A7209" ),
63
+ ( " 12.0.1" , "12A7300" ),
64
+ ]
65
65
66
66
# -----------------------------------------------------------------------------
67
67
# Helpers
@@ -166,10 +166,14 @@ def validate_xcode_compatibility():
166
166
167
167
version = shell .capture (
168
168
['xcodebuild' , '-version' ], dry_run = False , echo = False ).strip ()
169
- if not version .endswith (_SUPPORTED_XCODE_BUILDS ):
169
+
170
+ valid_build_numbers = tuple (x [1 ] for x in _SUPPORTED_XCODE_BUILDS )
171
+ if not version .endswith (valid_build_numbers ):
172
+ valid_versions_string = "\n " .join (
173
+ "{} ({})" .format (* x ) for x in _SUPPORTED_XCODE_BUILDS )
170
174
raise SystemExit (
171
- "error: using unsupported Xcode version:\n \n {}\n \n Install one of: {} " .format (
172
- version , ", " . join ( _SUPPORTED_XCODE_BUILDS )
175
+ "error: using unsupported Xcode version:\n \n {}\n \n Install one of:\n {} \n \n Or set 'SKIP_XCODE_VERSION_CHECK=1' in the environment " .format (
176
+ version , valid_versions_string
173
177
)
174
178
)
175
179
0 commit comments