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 shutil | 9 import shutil |
10 import sys | 10 import sys |
11 import utils | 11 import utils |
12 | 12 |
13 HOST_OS = utils.GuessOS() | 13 HOST_OS = utils.GuessOS() |
14 | 14 |
15 def BuildOptions(): | 15 def BuildOptions(): |
16 result = optparse.OptionParser() | 16 result = optparse.OptionParser() |
17 result.add_option("-m", "--mode", | 17 result.add_option("-m", "--mode", |
ahe
2012/11/15 11:42:21
This option is no longer necessary.
| |
18 help='Build variants (comma-separated).', | 18 help='Build variants (comma-separated).', |
19 metavar='[all,debug,release]', | 19 metavar='[all,debug,release]', |
20 default='all') | 20 default='all') |
21 result.add_option("--arch", | 21 result.add_option("--arch", |
ahe
2012/11/15 11:42:21
Ditto.
| |
22 help='Target architectures (comma-separated).', | 22 help='Target architectures (comma-separated).', |
23 metavar='[all,ia32,x64,simarm,arm]', | 23 metavar='[all,ia32,x64,simarm,arm]', |
24 default='all') | 24 default='all') |
25 result.add_option("--os", | 25 result.add_option("--os", |
26 help='Target OSs (comma-separated).', | 26 help='Target OSs (comma-separated).', |
27 metavar='[all,host,android]', | 27 metavar='[all,host,android]', |
28 default='all') | 28 default='all') |
29 return result | 29 return result |
30 | 30 |
31 | 31 |
(...skipping 28 matching lines...) Expand all Loading... | |
60 return False | 60 return False |
61 return True | 61 return True |
62 | 62 |
63 def Main(): | 63 def Main(): |
64 parser = BuildOptions() | 64 parser = BuildOptions() |
65 (options, args) = parser.parse_args() | 65 (options, args) = parser.parse_args() |
66 if not ProcessOptions(options): | 66 if not ProcessOptions(options): |
67 parser.print_help() | 67 parser.print_help() |
68 return 1 | 68 return 1 |
69 | 69 |
70 # Delete the output for the targets for each requested configuration. | 70 build_root = utils.GetBuildDir(HOST_OS, None) |
ahe
2012/11/15 11:42:21
for target_os in options.os:
build_root = utils.
| |
71 for mode in options.mode: | 71 shutil.rmtree(build_root, ignore_errors=True) |
72 for arch in options.arch: | |
73 for target_os in options.os: | |
74 build_root = utils.GetBuildRoot( | |
75 HOST_OS, mode=mode, arch=arch, target_os=target_os) | |
76 print "Deleting %s" % (build_root) | |
77 shutil.rmtree(build_root, ignore_errors=True) | |
78 return 0 | 72 return 0 |
79 | 73 |
80 if __name__ == '__main__': | 74 if __name__ == '__main__': |
81 sys.exit(Main()) | 75 sys.exit(Main()) |
OLD | NEW |