Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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()) |
| OLD | NEW |