Skip to content

Commit

Permalink
Fix XcodeVersion() parsing for Xcode 10.0
Browse files Browse the repository at this point in the history
Changes the output from '0100' to '1000' and fixes the parsing of `CLTVersion()` output too in case `xcodebuild -version` prints an unexpected output.
  • Loading branch information
pyrtsa authored and refack committed Nov 26, 2018
1 parent 1444f46 commit 291af50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,16 +1403,16 @@ def XcodeVersion():
except:
version = CLTVersion()
if version:
version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
version = re.search(r'^(\d{1,2}\.\d(\.\d+)?)', version).groups()[0]
else:
raise GypError("No Xcode or CLT version detected!")
# The CLT has no build information, so we return an empty string.
version_list = [version, '']
version = version_list[0]
build = version_list[-1]
# Be careful to convert "4.2" to "0420":
version = version.split()[-1].replace('.', '')
version = (version + '0' * (3 - len(version))).zfill(4)
# Be careful to convert "4.2" to "0420" and "10.0" to "1000":
version = format(''.join((version.split()[-1].split('.') + ['0', '0'])[:3]),
'>04s')
if build:
build = build.split()[-1]
XCODE_VERSION_CACHE = (version, build)
Expand Down

0 comments on commit 291af50

Please sign in to comment.