| 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 """ | 5 """ |
| 6 From a system-installed copy of the toolchain, packages all the required bits | 6 From a system-installed copy of the toolchain, packages all the required bits |
| 7 into a .zip file. | 7 into a .zip file. |
| 8 | 8 |
| 9 It assumes default install locations for tools, in particular: | 9 It assumes default install locations for tools, in particular: |
| 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... | 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 f.write('set %s=%s%s\n' % ( | 264 f.write('set %s=%s%s\n' % ( |
| 265 var, BatDirs(dirs), ';%PATH%' if var == 'PATH' else '')) | 265 var, BatDirs(dirs), ';%PATH%' if var == 'PATH' else '')) |
| 266 f.write('goto :EOF\n') | 266 f.write('goto :EOF\n') |
| 267 | 267 |
| 268 f.write(':x64\n') | 268 f.write(':x64\n') |
| 269 for var, dirs in env_x64.iteritems(): | 269 for var, dirs in env_x64.iteritems(): |
| 270 f.write('set %s=%s%s\n' % ( | 270 f.write('set %s=%s%s\n' % ( |
| 271 var, BatDirs(dirs), ';%PATH%' if var == 'PATH' else '')) | 271 var, BatDirs(dirs), ';%PATH%' if var == 'PATH' else '')) |
| 272 with open(set_env_prefix + '.x86.json', 'wb') as f: | 272 with open(set_env_prefix + '.x86.json', 'wb') as f: |
| 273 assert not set(env.keys()) & set(env_x86.keys()), 'dupe keys' | 273 assert not set(env.keys()) & set(env_x86.keys()), 'dupe keys' |
| 274 json.dump(collections.OrderedDict(env.items() + env_x86.items()), f) | 274 json.dump({'env': collections.OrderedDict(env.items() + env_x86.items())}, |
| 275 f) |
| 275 with open(set_env_prefix + '.x64.json', 'wb') as f: | 276 with open(set_env_prefix + '.x64.json', 'wb') as f: |
| 276 assert not set(env.keys()) & set(env_x64.keys()), 'dupe keys' | 277 assert not set(env.keys()) & set(env_x64.keys()), 'dupe keys' |
| 277 json.dump(collections.OrderedDict(env.items() + env_x64.items()), f) | 278 json.dump({'env': collections.OrderedDict(env.items() + env_x64.items())}, |
| 279 f) |
| 278 | 280 |
| 279 | 281 |
| 280 def AddEnvSetup(files): | 282 def AddEnvSetup(files): |
| 281 """We need to generate this file in the same way that the "from pieces" | 283 """We need to generate this file in the same way that the "from pieces" |
| 282 script does, so pull that in here.""" | 284 script does, so pull that in here.""" |
| 283 tempdir = tempfile.mkdtemp() | 285 tempdir = tempfile.mkdtemp() |
| 284 os.makedirs(os.path.join(tempdir, 'win_sdk', 'bin')) | 286 os.makedirs(os.path.join(tempdir, 'win_sdk', 'bin')) |
| 285 GenerateSetEnvCmd(tempdir) | 287 GenerateSetEnvCmd(tempdir) |
| 286 files.append((os.path.join(tempdir, 'win_sdk', 'bin', 'SetEnv.cmd'), | 288 files.append((os.path.join(tempdir, 'win_sdk', 'bin', 'SetEnv.cmd'), |
| 287 'win_sdk\\bin\\SetEnv.cmd')) | 289 'win_sdk\\bin\\SetEnv.cmd')) |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) | 381 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) |
| 380 sys.stdout.flush() | 382 sys.stdout.flush() |
| 381 | 383 |
| 382 RenameToSha1(output) | 384 RenameToSha1(output) |
| 383 | 385 |
| 384 return 0 | 386 return 0 |
| 385 | 387 |
| 386 | 388 |
| 387 if __name__ == '__main__': | 389 if __name__ == '__main__': |
| 388 sys.exit(main()) | 390 sys.exit(main()) |
| OLD | NEW |