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

Unified Diff: scripts/slave/compile.py

Issue 14602020: Add an AOSP builder recipe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 7 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: scripts/slave/compile.py
diff --git a/scripts/slave/compile.py b/scripts/slave/compile.py
index 86499db17ce73aedb581aff047f6d1beff846bfc..27d342470d791fb64352ce06d32e710dfba8e985 100755
--- a/scripts/slave/compile.py
+++ b/scripts/slave/compile.py
@@ -699,6 +699,50 @@ def main_make(options, args):
return result
+def main_make_android(options, args):
+ """Interprets options, clobbers object files, and calls make.
+ """
+
+ env = EchoDict(os.environ)
+ goma_ready = goma_setup(options, env)
+ if not goma_ready:
+ assert options.compiler not in ('goma', 'goma-clang')
+ assert options.goma_dir is None
+
+ options.build_dir = os.path.abspath(options.build_dir)
+
+ if goma_ready:
+ command = [os.path.join(options.goma_dir, 'goma-android-make')]
+ else:
+ command = ['make']
+
+ working_dir = options.src_dir
+
+ os.chdir(working_dir)
+
+ # V=1 prints the actual executed command
+ if options.verbose:
+ command.extend(['V=1'])
+ command.extend(options.build_args + args)
+
+ # Run the build.
+ env.print_overrides()
+ result = 0
+
+ def clobber():
+ print('Removing %s' % options.target_output_dir)
+ chromium_utils.RemoveDirectory(options.target_output_dir)
+
+ if options.clobber:
+ clobber()
+
+ result = chromium_utils.RunCommand(command, env=env)
+ if result and not options.clobber:
+ clobber()
+
+ goma_teardown(options, env)
+
+ return result
def main_ninja(options, args):
"""Interprets options, clobbers object files, and calls ninja."""
@@ -1068,6 +1112,8 @@ def get_target_build_dir(build_tool, src_dir, target, is_iphone=False):
target + ('-iphoneos' if is_iphone else ''))
elif build_tool == 'make':
ret = os.path.join(src_dir, 'out', target)
+ elif build_tool == 'make-android':
+ ret = os.path.join(src_dir, 'out')
elif build_tool == 'ninja':
ret = os.path.join(src_dir, 'out', target)
elif build_tool in ['msvs', 'vs', 'ib']:
@@ -1103,6 +1149,12 @@ def real_main():
option_parser.add_option('', '--build-dir', default='build',
help='path to directory containing solution and in '
'which the build output will be placed')
+ option_parser.add_option('', '--src-dir', default=None,
+ help='path to directory containing the root of the '
+ 'source tree')
+ option_parser.add_option('', '--target-output-dir', default=None,
+ help='path to directory containing the root of the '
+ 'output folder')
option_parser.add_option('', '--mode', default='dev',
help='build mode (dev or official) controlling '
'environment variables set during build')
@@ -1155,6 +1207,7 @@ def real_main():
'ib' : main_win,
'vs' : main_win,
'make' : main_make,
+ 'make-android' : main_make_android,
'ninja' : main_ninja,
'scons' : main_scons,
'xcode' : main_xcode,
@@ -1165,8 +1218,9 @@ def real_main():
return 2
options.build_dir = os.path.abspath(options.build_dir)
- options.src_dir = os.path.join(slave_utils.SlaveBaseDir(
- os.path.abspath(options.build_dir)), 'build', 'src')
+ if not options.src_dir:
+ options.src_dir = os.path.join(slave_utils.SlaveBaseDir(
+ os.path.abspath(options.build_dir)), 'build', 'src')
options.target_output_dir = get_target_build_dir(options.build_tool,
options.src_dir, options.target, 'iphoneos' in args)
options.clobber = (options.clobber or

Powered by Google App Engine
This is Rietveld 408576698