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

Side by Side Diff: win_toolchain/package_from_installed.py

Issue 1718083003: package_from_installed: Put env in json file behind "env" key. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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 # 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
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
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())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698