OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import json | 5 import json |
6 import os | 6 import os |
7 import pipes | 7 import pipes |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 def SetEnvironmentAndGetRuntimeDllDirs(): | 24 def SetEnvironmentAndGetRuntimeDllDirs(): |
25 """Sets up os.environ to use the depot_tools VS toolchain with gyp, and | 25 """Sets up os.environ to use the depot_tools VS toolchain with gyp, and |
26 returns the location of the VS runtime DLLs so they can be copied into | 26 returns the location of the VS runtime DLLs so they can be copied into |
27 the output directory after gyp generation. | 27 the output directory after gyp generation. |
28 """ | 28 """ |
29 vs2013_runtime_dll_dirs = None | 29 vs2013_runtime_dll_dirs = None |
30 depot_tools_win_toolchain = \ | 30 depot_tools_win_toolchain = \ |
31 bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) | 31 bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) |
32 if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain: | 32 if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain: |
| 33 if not os.path.exists(json_data_file): |
| 34 Update() |
33 with open(json_data_file, 'r') as tempf: | 35 with open(json_data_file, 'r') as tempf: |
34 toolchain_data = json.load(tempf) | 36 toolchain_data = json.load(tempf) |
35 | 37 |
36 toolchain = toolchain_data['path'] | 38 toolchain = toolchain_data['path'] |
37 version = toolchain_data['version'] | 39 version = toolchain_data['version'] |
38 version_is_pro = version[-1] != 'e' | 40 version_is_pro = version[-1] != 'e' |
39 win8sdk = toolchain_data['win8sdk'] | 41 win8sdk = toolchain_data['win8sdk'] |
40 wdk = toolchain_data['wdk'] | 42 wdk = toolchain_data['wdk'] |
41 # TODO(scottmg): The order unfortunately matters in these. They should be | 43 # TODO(scottmg): The order unfortunately matters in these. They should be |
42 # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call | 44 # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 # CopyVsRuntimeDlls via import, currently). | 185 # CopyVsRuntimeDlls via import, currently). |
184 } | 186 } |
185 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 187 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
186 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 188 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
187 return 1 | 189 return 1 |
188 return commands[sys.argv[1]]() | 190 return commands[sys.argv[1]]() |
189 | 191 |
190 | 192 |
191 if __name__ == '__main__': | 193 if __name__ == '__main__': |
192 sys.exit(main()) | 194 sys.exit(main()) |
OLD | NEW |