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 shutil | 10 import shutil |
(...skipping 12 matching lines...) Expand all Loading... |
23 result = optparse.OptionParser() | 23 result = optparse.OptionParser() |
24 result.add_option("-m", "--mode", | 24 result.add_option("-m", "--mode", |
25 help='Build variants (comma-separated).', | 25 help='Build variants (comma-separated).', |
26 metavar='[all,debug,release]', | 26 metavar='[all,debug,release]', |
27 default='debug') | 27 default='debug') |
28 result.add_option("-v", "--verbose", | 28 result.add_option("-v", "--verbose", |
29 help='Verbose output.', | 29 help='Verbose output.', |
30 default=False, action="store_true") | 30 default=False, action="store_true") |
31 result.add_option("-a", "--arch", | 31 result.add_option("-a", "--arch", |
32 help='Target architectures (comma-separated).', | 32 help='Target architectures (comma-separated).', |
33 metavar='[all,ia32,x64,simarm,arm]', | 33 metavar='[all,ia32,x64,simarm,arm,simmips,mips]', |
34 default=utils.GuessArchitecture()) | 34 default=utils.GuessArchitecture()) |
35 result.add_option("--os", | 35 result.add_option("--os", |
36 help='Target OSs (comma-separated).', | 36 help='Target OSs (comma-separated).', |
37 metavar='[all,host,android]', | 37 metavar='[all,host,android]', |
38 default='host') | 38 default='host') |
39 result.add_option("-j", | 39 result.add_option("-j", |
40 help='The number of parallel jobs to run.', | 40 help='The number of parallel jobs to run.', |
41 metavar=HOST_CPUS, | 41 metavar=HOST_CPUS, |
42 default=str(HOST_CPUS)) | 42 default=str(HOST_CPUS)) |
43 result.add_option("--devenv", | 43 result.add_option("--devenv", |
(...skipping 20 matching lines...) Expand all Loading... |
64 if options.os == 'all': | 64 if options.os == 'all': |
65 options.os = 'host,android' | 65 options.os = 'host,android' |
66 options.mode = options.mode.split(',') | 66 options.mode = options.mode.split(',') |
67 options.arch = options.arch.split(',') | 67 options.arch = options.arch.split(',') |
68 options.os = options.os.split(',') | 68 options.os = options.os.split(',') |
69 for mode in options.mode: | 69 for mode in options.mode: |
70 if not mode in ['debug', 'release']: | 70 if not mode in ['debug', 'release']: |
71 print "Unknown mode %s" % mode | 71 print "Unknown mode %s" % mode |
72 return False | 72 return False |
73 for arch in options.arch: | 73 for arch in options.arch: |
74 if not arch in ['ia32', 'x64', 'simarm', 'arm']: | 74 if not arch in ['ia32', 'x64', 'simarm', 'arm', 'simmips', 'mips']: |
75 print "Unknown arch %s" % arch | 75 print "Unknown arch %s" % arch |
76 return False | 76 return False |
77 options.os = [ProcessOsOption(os) for os in options.os] | 77 options.os = [ProcessOsOption(os) for os in options.os] |
78 for os in options.os: | 78 for os in options.os: |
79 if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']: | 79 if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']: |
80 print "Unknown os %s" % os | 80 print "Unknown os %s" % os |
81 return False | 81 return False |
82 if os != HOST_OS: | 82 if os != HOST_OS: |
83 if os != 'android': | 83 if os != 'android': |
84 print "Unsupported target os %s" % os | 84 print "Unsupported target os %s" % os |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 process.wait() | 319 process.wait() |
320 if process.returncode != 0: | 320 if process.returncode != 0: |
321 print "BUILD FAILED" | 321 print "BUILD FAILED" |
322 return 1 | 322 return 1 |
323 | 323 |
324 return 0 | 324 return 0 |
325 | 325 |
326 | 326 |
327 if __name__ == '__main__': | 327 if __name__ == '__main__': |
328 sys.exit(Main()) | 328 sys.exit(Main()) |
OLD | NEW |