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

Side by Side Diff: build/mac_toolchain.py

Issue 1834183002: Followup to 'Scripts to upload and update the mac toolchain.' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Erik comments Created 4 years, 8 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/gyp_environment.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Download necessary mac toolchain files under certain conditions. If 6 """Download necessary mac toolchain files under certain conditions. If
7 xcode-select is already set and points to an external folder 7 xcode-select is already set and points to an external folder
8 (e.g. /Application/Xcode.app), this script only runs if the GYP_DEFINE 8 (e.g. /Application/Xcode.app), this script only runs if the GYP_DEFINE
9 |force_mac_toolchain| is set. To override the values in 9 |force_mac_toolchain| is set. To override the values in
10 |TOOLCHAIN_REVISION|-|TOOLCHAIN_SUB_REVISION| below, GYP_DEFINE 10 |TOOLCHAIN_REVISION|-|TOOLCHAIN_SUB_REVISION| below, GYP_DEFINE
(...skipping 22 matching lines...) Expand all
33 33
34 BASE_DIR = os.path.abspath(os.path.dirname(__file__)) 34 BASE_DIR = os.path.abspath(os.path.dirname(__file__))
35 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app') 35 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app')
36 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision') 36 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision')
37 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/' 37 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/'
38 38
39 39
40 def GetToolchainDirectory(): 40 def GetToolchainDirectory():
41 if sys.platform == 'darwin' and not UseLocalMacSDK(): 41 if sys.platform == 'darwin' and not UseLocalMacSDK():
42 return TOOLCHAIN_BUILD_DIR 42 return TOOLCHAIN_BUILD_DIR
43 else:
44 return None
43 45
44 46
45 def ReadStampFile(): 47 def ReadStampFile():
46 """Return the contents of the stamp file, or '' if it doesn't exist.""" 48 """Return the contents of the stamp file, or '' if it doesn't exist."""
47 try: 49 try:
48 with open(STAMP_FILE, 'r') as f: 50 with open(STAMP_FILE, 'r') as f:
49 return f.read().rstrip() 51 return f.read().rstrip()
50 except IOError: 52 except IOError:
51 return '' 53 return ''
52 54
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 print 'Toolchain %s unpacked.' % toolchain_revision 147 print 'Toolchain %s unpacked.' % toolchain_revision
146 WriteStampFile(toolchain_revision) 148 WriteStampFile(toolchain_revision)
147 return 0 149 return 0
148 except: 150 except:
149 print 'Failed to download toolchain %s.' % toolchain_file 151 print 'Failed to download toolchain %s.' % toolchain_file
150 print 'Exiting.' 152 print 'Exiting.'
151 return 1 153 return 1
152 154
153 if __name__ == '__main__': 155 if __name__ == '__main__':
154 sys.exit(main()) 156 sys.exit(main())
OLDNEW
« no previous file with comments | « build/gyp_environment.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698