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

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: 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 # Change current directory to the repo root: the rest of this script
515 # assumes it is running from the repo root.
516 this_script = os.path.abspath(__file__)
517 this_dir = os.path.dirname(this_script)
518 repo_root = os.path.join(this_dir, os.path.pardir)
519 os.chdir(repo_root)
zra 2014/09/15 20:31:40 instead maybe: if os.getcwd() != utils.DART_DIR:
Nathan Collins 2014/09/16 01:05:08 Yes, that's much simpler! I don't see the point of
520
514 utils.ConfigureJava() 521 utils.ConfigureJava()
515 # Parse the options. 522 # Parse the options.
516 parser = BuildOptions() 523 parser = BuildOptions()
517 (options, args) = parser.parse_args() 524 (options, args) = parser.parse_args()
518 if not ProcessOptions(options, args): 525 if not ProcessOptions(options, args):
519 parser.print_help() 526 parser.print_help()
520 return 1 527 return 1
521 # Determine which targets to build. By default we build the "all" target. 528 # Determine which targets to build. By default we build the "all" target.
522 if len(args) == 0: 529 if len(args) == 0:
523 if HOST_OS == 'macos': 530 if HOST_OS == 'macos':
(...skipping 15 matching lines...) Expand all
539 else: 546 else:
540 if BuildOneConfig(options, target, target_os, 547 if BuildOneConfig(options, target, target_os,
541 mode, arch, cross_build) != 0: 548 mode, arch, cross_build) != 0:
542 return 1 549 return 1
543 550
544 return 0 551 return 0
545 552
546 553
547 if __name__ == '__main__': 554 if __name__ == '__main__':
548 sys.exit(Main()) 555 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