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

Unified Diff: tools/clean_output_directory.py

Issue 10823209: Add support for building the Dart VM for Android OS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: build.py learned --os all option to build for both host and android. Created 8 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: tools/clean_output_directory.py
diff --git a/tools/clean_output_directory.py b/tools/clean_output_directory.py
index 485a5c4d295607a223d73080fe91b3f87b586101..4cece01a61743f6f43d0b07676dda5ef307b686a 100755
--- a/tools/clean_output_directory.py
+++ b/tools/clean_output_directory.py
@@ -22,15 +22,29 @@ def BuildOptions():
help='Target architectures (comma-separated).',
metavar='[all,ia32,x64,simarm,arm]',
default=utils.GuessArchitecture())
+ result.add_option("--os",
+ help='Target OSs (comma-separated).',
+ metavar='[all,host,android]',
+ default='all')
return result
+
+def ProcessOsOption(os):
+ if os == 'host':
+ return HOST_OS
+ return os
+
+
def ProcessOptions(options):
if options.arch == 'all':
options.arch = 'ia32,x64'
if options.mode == 'all':
options.mode = 'release,debug'
+ if options.os == 'all':
+ options.os = 'host,android'
options.mode = options.mode.split(',')
options.arch = options.arch.split(',')
+ options.os = options.os.split(',')
for mode in options.mode:
if not mode in ['debug', 'release']:
print "Unknown mode %s" % mode
@@ -39,6 +53,11 @@ def ProcessOptions(options):
if not arch in ['ia32', 'x64', 'simarm', 'arm']:
print "Unknown arch %s" % arch
return False
+ options.os = [ProcessOsOption(os) for os in options.os]
+ for os in options.os:
+ if not os in ['android', 'freebsd', 'linux', 'macos', 'win32']:
+ print "Unknown os %s" % os
+ return False
return True
def Main():
@@ -51,14 +70,16 @@ def Main():
# Delete the output for the targets for each requested configuration.
for mode in options.mode:
for arch in options.arch:
- build_root = utils.GetBuildRoot(HOST_OS, mode=mode, arch=arch)
- print "Deleting %s" % (build_root)
- shutil.rmtree(build_root, ignore_errors=True)
- # On windows we have additional object files within the runtime library.
- if HOST_OS == 'win32':
- runtime_root = 'runtime/' + build_root
- print "Deleting %s" % (runtime_root)
- shutil.rmtree(runtime_root, ignore_errors=True)
+ for target_os in options.os:
+ build_root = utils.GetBuildRoot(
+ HOST_OS, mode=mode, arch=arch, target_os=target_os)
+ print "Deleting %s" % (build_root)
+ shutil.rmtree(build_root, ignore_errors=True)
+ # On windows we have additional object files within the runtime library.
+ if HOST_OS == 'win32':
+ runtime_root = 'runtime/' + build_root
+ print "Deleting %s" % (runtime_root)
+ shutil.rmtree(runtime_root, ignore_errors=True)
return 0
if __name__ == '__main__':

Powered by Google App Engine
This is Rietveld 408576698