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

Side by Side Diff: go/bootstrap.py

Issue 2071243002: infra/go: Adding setup instructions and quick setup script. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: cd into the source area. Created 4 years, 6 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 | « go/README.md ('k') | go/quicksetup.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Prepares a local hermetic Go installation. 6 """Prepares a local hermetic Go installation.
7 7
8 - Downloads and unpacks the Go toolset in ../../golang. 8 - Downloads and unpacks the Go toolset in ../../golang.
9 - Downloads and installs Glide (used by deps.py). 9 - Downloads and installs Glide (used by deps.py).
10 - Fetches code dependencies via deps.py. 10 - Fetches code dependencies via deps.py.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's 424 # APPENGINE_DEV_APPSERVER is used by "appengine/aetest" package. If it's
425 # missing, aetest will scan PATH looking for dev_appserver.py, possibly 425 # missing, aetest will scan PATH looking for dev_appserver.py, possibly
426 # finding it in some other place. 426 # finding it in some other place.
427 if go_appengine_path: 427 if go_appengine_path:
428 env['APPENGINE_DEV_APPSERVER'] = os.path.join( 428 env['APPENGINE_DEV_APPSERVER'] = os.path.join(
429 go_appengine_path, 'dev_appserver.py') 429 go_appengine_path, 'dev_appserver.py')
430 else: 430 else:
431 env.pop('APPENGINE_DEV_APPSERVER', None) 431 env.pop('APPENGINE_DEV_APPSERVER', None)
432 432
433 # Add a tag to the prompt
dnj (Google) 2016/07/01 01:40:42 This broke my shell prompt. Is it really necessary
434 prompt = env.get('PS1')
435 if prompt:
436 prompttag = env.get('INFRA_PROMPT_TAG', '[cr go] ')
437 if prompttag not in prompt:
438 env['PS1'] = prompttag + prompt
439
433 return env 440 return env
434 441
435 442
436 def get_go_exe(toolset_root): 443 def get_go_exe(toolset_root):
437 """Returns path to go executable.""" 444 """Returns path to go executable."""
438 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX) 445 return os.path.join(toolset_root, 'go', 'bin', 'go' + EXE_SFX)
439 446
440 447
441 def bootstrap(go_paths, logging_level, toolset=None): 448 def bootstrap(go_paths, logging_level, toolset=None):
442 """Installs all dependencies in default locations. 449 """Installs all dependencies in default locations.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 'Linux') 576 'Linux')
570 577
571 bootstrap([WORKSPACE], logging.DEBUG, toolset=opts.toolset) 578 bootstrap([WORKSPACE], logging.DEBUG, toolset=opts.toolset)
572 if opts.build_cross: 579 if opts.build_cross:
573 build_cross_toolset(opts.toolset) 580 build_cross_toolset(opts.toolset)
574 return 0 581 return 0
575 582
576 583
577 if __name__ == '__main__': 584 if __name__ == '__main__':
578 sys.exit(main(sys.argv[1:])) 585 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « go/README.md ('k') | go/quicksetup.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698