| OLD | NEW |
| 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 12 matching lines...) Expand all Loading... |
| 23 import shutil | 23 import shutil |
| 24 import subprocess | 24 import subprocess |
| 25 import sys | 25 import sys |
| 26 import tarfile | 26 import tarfile |
| 27 import time | 27 import time |
| 28 import tempfile | 28 import tempfile |
| 29 import urllib2 | 29 import urllib2 |
| 30 | 30 |
| 31 # This can be changed after running /build/package_mac_toolchain.py. | 31 # This can be changed after running /build/package_mac_toolchain.py. |
| 32 TOOLCHAIN_REVISION = '5B1008' | 32 TOOLCHAIN_REVISION = '5B1008' |
| 33 TOOLCHAIN_SUB_REVISION = 2 | 33 TOOLCHAIN_SUB_REVISION = 3 |
| 34 TOOLCHAIN_VERSION = '%s-%s' % (TOOLCHAIN_REVISION, TOOLCHAIN_SUB_REVISION) | 34 TOOLCHAIN_VERSION = '%s-%s' % (TOOLCHAIN_REVISION, TOOLCHAIN_SUB_REVISION) |
| 35 | 35 |
| 36 BASE_DIR = os.path.abspath(os.path.dirname(__file__)) | 36 BASE_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 37 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app') | 37 TOOLCHAIN_BUILD_DIR = os.path.join(BASE_DIR, 'mac_files', 'Xcode.app') |
| 38 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision') | 38 STAMP_FILE = os.path.join(BASE_DIR, 'mac_files', 'toolchain_build_revision') |
| 39 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/' | 39 TOOLCHAIN_URL = 'gs://chrome-mac-sdk/' |
| 40 | 40 |
| 41 | 41 |
| 42 def GetToolchainDirectory(): | 42 def GetToolchainDirectory(): |
| 43 if sys.platform == 'darwin' and not UseLocalMacSDK(): | 43 if sys.platform == 'darwin' and not UseLocalMacSDK(): |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 WriteStampFile(toolchain_revision) | 200 WriteStampFile(toolchain_revision) |
| 201 return 0 | 201 return 0 |
| 202 except Exception as e: | 202 except Exception as e: |
| 203 print 'Failed to download toolchain %s.' % toolchain_file | 203 print 'Failed to download toolchain %s.' % toolchain_file |
| 204 print 'Exception %s' % e | 204 print 'Exception %s' % e |
| 205 print 'Exiting.' | 205 print 'Exiting.' |
| 206 return 1 | 206 return 1 |
| 207 | 207 |
| 208 if __name__ == '__main__': | 208 if __name__ == '__main__': |
| 209 sys.exit(main()) | 209 sys.exit(main()) |
| OLD | NEW |