| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2017 The Dart project authors. All rights reserved. | 2 # Copyright 2017 The Dart project 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 """Pulls down tools required to build Dart.""" | 6 """Pulls down tools required to build Dart.""" |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import shutil | 10 import shutil |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) | 13 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 14 DART_ROOT = os.path.abspath(os.path.join(THIS_DIR, '..', '..')) | 14 DART_ROOT = os.path.abspath(os.path.join(THIS_DIR, '..', '..')) |
| 15 BUILDTOOLS = os.path.join(DART_ROOT, 'buildtools') | 15 BUILDTOOLS = os.path.join(DART_ROOT, 'buildtools') |
| 16 TOOLS_BUILDTOOLS = os.path.join(DART_ROOT, 'tools', 'buildtools') | 16 TOOLS_BUILDTOOLS = os.path.join(DART_ROOT, 'tools', 'buildtools') |
| 17 TOOLCHAIN = os.path.join(BUILDTOOLS, 'toolchain') | 17 TOOLCHAIN = os.path.join(BUILDTOOLS, 'toolchain') |
| 18 | 18 |
| 19 sys.path.insert(0, os.path.join(DART_ROOT, 'tools')) | 19 sys.path.insert(0, os.path.join(DART_ROOT, 'tools')) |
| 20 import find_depot_tools | 20 import find_depot_tools |
| 21 | 21 |
| 22 DEPOT_PATH = find_depot_tools.add_depot_tools_to_path() | 22 DEPOT_PATH = find_depot_tools.add_depot_tools_to_path() |
| 23 | 23 |
| 24 | 24 |
| 25 def Update(): | 25 def Update(): |
| 26 path = os.path.join(BUILDTOOLS, 'update.sh') | 26 path = os.path.join(BUILDTOOLS, 'update.sh') |
| 27 command = ['/bin/bash', path, '--toolchain', '--gn'] | 27 command = ['/bin/bash', path, '--clang', '--gn'] |
| 28 return subprocess.call(command, cwd=DART_ROOT) | 28 return subprocess.call(command, cwd=DART_ROOT) |
| 29 | 29 |
| 30 | 30 |
| 31 def UpdateGNOnWindows(): | 31 def UpdateGNOnWindows(): |
| 32 sha1_file = os.path.join(BUILDTOOLS, 'win', 'gn.exe.sha1') | 32 sha1_file = os.path.join(BUILDTOOLS, 'win', 'gn.exe.sha1') |
| 33 downloader_script = os.path.join( | 33 downloader_script = os.path.join( |
| 34 DEPOT_PATH, 'download_from_google_storage.py') | 34 DEPOT_PATH, 'download_from_google_storage.py') |
| 35 download_cmd = [ | 35 download_cmd = [ |
| 36 'python', | 36 'python', |
| 37 downloader_script, | 37 downloader_script, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 if result != 0: | 95 if result != 0: |
| 96 return result | 96 return result |
| 97 return UpdateClangFormatOnWindows() | 97 return UpdateClangFormatOnWindows() |
| 98 if Update() != 0: | 98 if Update() != 0: |
| 99 return 1 | 99 return 1 |
| 100 return CopyClangFormat() | 100 return CopyClangFormat() |
| 101 | 101 |
| 102 | 102 |
| 103 if __name__ == '__main__': | 103 if __name__ == '__main__': |
| 104 sys.exit(main(sys.argv)) | 104 sys.exit(main(sys.argv)) |
| OLD | NEW |