| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Dart project authors. All rights reserved. | 2 # Copyright 2016 The Dart project 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 import argparse | 6 import argparse |
| 7 import multiprocessing | 7 import multiprocessing |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 default=use_wheezy(), | 360 default=use_wheezy(), |
| 361 action='store_true') | 361 action='store_true') |
| 362 other_group.add_argument('--no-wheezy', | 362 other_group.add_argument('--no-wheezy', |
| 363 help='Disable the Debian wheezy sysroot on Linux', | 363 help='Disable the Debian wheezy sysroot on Linux', |
| 364 dest='wheezy', | 364 dest='wheezy', |
| 365 action='store_false') | 365 action='store_false') |
| 366 other_group.add_argument('--workers', '-w', | 366 other_group.add_argument('--workers', '-w', |
| 367 type=int, | 367 type=int, |
| 368 help='Number of simultaneous GN invocations', | 368 help='Number of simultaneous GN invocations', |
| 369 dest='workers', | 369 dest='workers', |
| 370 default=multiprocessing.cpu_count()) | 370 # Set to multiprocessing.cpu_count() when GN can be run in parallel. |
| 371 default=1) |
| 371 | 372 |
| 372 options = parser.parse_args(args) | 373 options = parser.parse_args(args) |
| 373 if not process_options(options): | 374 if not process_options(options): |
| 374 parser.print_help() | 375 parser.print_help() |
| 375 return None | 376 return None |
| 376 return options | 377 return options |
| 377 | 378 |
| 378 | 379 |
| 379 def run_command(command): | 380 def run_command(command): |
| 380 try: | 381 try: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 return 1 | 428 return 1 |
| 428 | 429 |
| 429 endtime = time.time() | 430 endtime = time.time() |
| 430 if args.verbose: | 431 if args.verbose: |
| 431 print ("GN Time: %.3f seconds" % (endtime - starttime)) | 432 print ("GN Time: %.3f seconds" % (endtime - starttime)) |
| 432 return 0 | 433 return 0 |
| 433 | 434 |
| 434 | 435 |
| 435 if __name__ == '__main__': | 436 if __name__ == '__main__': |
| 436 sys.exit(main(sys.argv)) | 437 sys.exit(main(sys.argv)) |
| OLD | NEW |