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

Side by Side Diff: tools/build.py

Issue 569343003: Make 'tools/build.py -h' warn the user to run it from the repo root. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make fix more conservative: simply fail on wrong cwd. Created 6 years, 3 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 | Annotate | Revision Log
« 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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
4 # for details. All rights reserved. Use of this source code is governed by a 4 # for details. All rights reserved. Use of this source code is governed by a
5 # BSD-style license that can be found in the LICENSE file. 5 # BSD-style license that can be found in the LICENSE file.
6 # 6 #
7 7
8 import optparse 8 import optparse
9 import os 9 import os
10 import re 10 import re
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 if toolchainprefix == None: 504 if toolchainprefix == None:
505 print "Couldn't figure out the cross-toolchain" 505 print "Couldn't figure out the cross-toolchain"
506 return 1 506 return 1
507 strip = toolchainprefix + '-strip' 507 strip = toolchainprefix + '-strip'
508 subprocess.call([strip, os.path.join(bin, 'dart')]) 508 subprocess.call([strip, os.path.join(bin, 'dart')])
509 509
510 return 0 510 return 0
511 511
512 512
513 def Main(): 513 def Main():
514 # This script assumes it is running from the repo root and can
515 # silently fail when that's not true. A more user friendly option
516 # would be to make it run from anywhere. For now we just fail early
517 # and loudly.
518 if os.path.abspath(utils.DART_DIR) != os.path.abspath(os.getcwd()):
Ivan Posva 2014/09/17 03:48:55 This is not entirely correct. Sometimes you need t
519 print 'This script must be run from the repo root!'
520 print 'Please cd into'
521 print ''
522 print ' %s' % utils.DART_DIR
523 print ''
524 print 'before running.'
525 return 1
526
514 utils.ConfigureJava() 527 utils.ConfigureJava()
515 # Parse the options. 528 # Parse the options.
516 parser = BuildOptions() 529 parser = BuildOptions()
517 (options, args) = parser.parse_args() 530 (options, args) = parser.parse_args()
518 if not ProcessOptions(options, args): 531 if not ProcessOptions(options, args):
519 parser.print_help() 532 parser.print_help()
520 return 1 533 return 1
521 # Determine which targets to build. By default we build the "all" target. 534 # Determine which targets to build. By default we build the "all" target.
522 if len(args) == 0: 535 if len(args) == 0:
523 if HOST_OS == 'macos': 536 if HOST_OS == 'macos':
(...skipping 15 matching lines...) Expand all
539 else: 552 else:
540 if BuildOneConfig(options, target, target_os, 553 if BuildOneConfig(options, target, target_os,
541 mode, arch, cross_build) != 0: 554 mode, arch, cross_build) != 0:
542 return 1 555 return 1
543 556
544 return 0 557 return 0
545 558
546 559
547 if __name__ == '__main__': 560 if __name__ == '__main__':
548 sys.exit(Main()) 561 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