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

Unified Diff: tools/dartium/build.py

Issue 244643006: Migrate dartium_tools from chrome branch to dart repo (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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/dartium/build.py
diff --git a/tools/dartium/build.py b/tools/dartium/build.py
new file mode 100755
index 0000000000000000000000000000000000000000..df511b0010c2988812947512aca4bf66ccb85c6d
--- /dev/null
+++ b/tools/dartium/build.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+#
+# Copyright 2010 Google Inc. All Rights Reserved.
+
+# This file is used by the buildbot.
+
+import optparse
+import os.path
+import utils
+
+ALL_TARGETS = [
+ 'content_shell',
+ 'chrome',
+ 'blink_tests',
+ 'pkg_packages',
+]
+
+def main():
+ parser = optparse.OptionParser()
+ parser.add_option('--target', dest='target',
+ default='all',
+ action='store', type='string',
+ help='Target (%s)' % ', '.join(ALL_TARGETS))
+ parser.add_option('--mode', dest='mode',
+ action='store', type='string',
+ help='Build mode (Debug or Release)')
+ parser.add_option('--clobber', dest='clobber',
+ action='store_true',
+ help='Clobber the output directory')
+ parser.add_option('-j', '--jobs', dest='jobs',
+ action='store',
+ help='Number of jobs')
+ (options, args) = parser.parse_args()
+ mode = options.mode
+ if options.jobs:
+ jobs = options.jobs
+ else:
+ jobs = utils.guessCpus()
+ if not (mode in ['Debug', 'Release']):
+ raise Exception('Invalid build mode')
+
+ if options.target == 'all':
+ targets = ALL_TARGETS
+ else:
+ targets = [options.target]
+
+ if options.clobber:
+ utils.runCommand(['rm', '-rf', 'out'])
+
+ utils.runCommand(['ninja',
+ '-j%s' % jobs,
+ '-C',
+ os.path.join('out', mode)]
+ + targets)
+
+if __name__ == '__main__':
+ main()

Powered by Google App Engine
This is Rietveld 408576698