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 os.chdir(utils.DART_DIR) | |
|
ricow1
2014/09/16 08:11:29
to be nice and change back you could do:
with util
Nathan Collins
2014/09/16 17:38:57
This couldn't hurt, but the cd was happening in th
| |
| 517 | |
| 514 utils.ConfigureJava() | 518 utils.ConfigureJava() |
| 515 # Parse the options. | 519 # Parse the options. |
| 516 parser = BuildOptions() | 520 parser = BuildOptions() |
| 517 (options, args) = parser.parse_args() | 521 (options, args) = parser.parse_args() |
| 518 if not ProcessOptions(options, args): | 522 if not ProcessOptions(options, args): |
| 519 parser.print_help() | 523 parser.print_help() |
| 520 return 1 | 524 return 1 |
| 521 # Determine which targets to build. By default we build the "all" target. | 525 # Determine which targets to build. By default we build the "all" target. |
| 522 if len(args) == 0: | 526 if len(args) == 0: |
| 523 if HOST_OS == 'macos': | 527 if HOST_OS == 'macos': |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 539 else: | 543 else: |
| 540 if BuildOneConfig(options, target, target_os, | 544 if BuildOneConfig(options, target, target_os, |
| 541 mode, arch, cross_build) != 0: | 545 mode, arch, cross_build) != 0: |
| 542 return 1 | 546 return 1 |
| 543 | 547 |
| 544 return 0 | 548 return 0 |
| 545 | 549 |
| 546 | 550 |
| 547 if __name__ == '__main__': | 551 if __name__ == '__main__': |
| 548 sys.exit(Main()) | 552 sys.exit(Main()) |
| OLD | NEW |