Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(850)

Side by Side Diff: build/config/mac/sdk_info.py

Issue 2023703002: Beginning work on GN build (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Really add //build. Add dart_bootstrap rule. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/config/mac/rules.gni ('k') | build/config/mac/xcrun.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import os
6 import subprocess
7 import sys
8
9 # This script prints information about the build system, the operating
10 # system and the iOS or Mac SDK (depending on the platform "iphonesimulator",
11 # "iphoneos" or "macosx" generally).
12 #
13 # In the GYP build, this is done inside GYP itself based on the SDKROOT
14 # variable.
15
16 def FormatVersion(version):
17 """Converts Xcode version to a format required for Info.plist."""
18 version = version.replace('.', '')
19 version = version + '0' * (3 - len(version))
20 return version.zfill(4)
21
22
23 def FillXcodeVersion(settings):
24 """Fills the Xcode version and build number into |settings|."""
25 lines = subprocess.check_output(['xcodebuild', '-version']).splitlines()
26 settings['xcode_version'] = FormatVersion(lines[0].split()[-1])
27 settings['xcode_build'] = lines[-1].split()[-1]
28
29
30 def FillMachineOSBuild(settings):
31 """Fills OS build number into |settings|."""
32 settings['machine_os_build'] = subprocess.check_output(
33 ['sw_vers', '-buildVersion']).strip()
34
35
36 def FillSDKPathAndVersion(settings, platform, xcode_version):
37 """Fills the SDK path and version for |platform| into |settings|."""
38 settings['sdk_path'] = subprocess.check_output([
39 'xcrun', '-sdk', platform, '--show-sdk-path']).strip()
40 settings['sdk_version'] = subprocess.check_output([
41 'xcrun', '-sdk', platform, '--show-sdk-version']).strip()
42 # TODO: unconditionally use --show-sdk-build-version once Xcode 7.2 or
43 # higher is required to build Chrome for iOS or OS X.
44 if xcode_version >= '0720':
45 settings['sdk_build'] = subprocess.check_output([
46 'xcrun', '-sdk', platform, '--show-sdk-build-version']).strip()
47 else:
48 settings['sdk_build'] = settings['sdk_version']
49
50
51 if __name__ == '__main__':
52 if len(sys.argv) != 2:
53 sys.stderr.write(
54 'usage: %s [iphoneos|iphonesimulator|macosx]\n' %
55 os.path.basename(sys.argv[0]))
56 sys.exit(1)
57
58 settings = {}
59 FillMachineOSBuild(settings)
60 FillXcodeVersion(settings)
61 FillSDKPathAndVersion(settings, sys.argv[1], settings['xcode_version'])
62
63 for key in sorted(settings):
64 print '%s="%s"' % (key, settings[key])
OLDNEW
« no previous file with comments | « build/config/mac/rules.gni ('k') | build/config/mac/xcrun.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698