Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: tools/clean_output_directory.py

Issue 11348061: Always clobber all of the output directory (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698