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

Unified Diff: scripts/slave/recipes/android_webview_aosp.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
« no previous file with comments | « scripts/slave/compile.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipes/android_webview_aosp.py
diff --git a/scripts/slave/recipes/android_webview_aosp.py b/scripts/slave/recipes/android_webview_aosp.py
new file mode 100644
index 0000000000000000000000000000000000000000..2a06efab981dbc9df9e47c409ad19fe5d34913a2
--- /dev/null
+++ b/scripts/slave/recipes/android_webview_aosp.py
@@ -0,0 +1,217 @@
+# Copyright (c) 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import os
+
+try:
+ import json # pylint: disable=F0401
+except ImportError:
+ import simplejson as json
+
+def deps_blacklist(path_to_whitelist_script, path_to_deps_file):
+ local_vars = {}
+ execfile(path_to_whitelist_script, {'os': os}, local_vars)
+ deps_whitelist = local_vars['DepsWhitelist']()
+ return deps_whitelist.get_aosp_bot_deps_blacklist(path_to_deps_file)
+
+def GetFactoryProperties(api, factory_properties, build_properties):
+ android_repo_url = factory_properties.get('android_repo_url')
+ android_repo_sync_flags = factory_properties.get('android_repo_sync_flags',
+ ['-j16', '-d', '-f'])
+ android_repo_resync_projects = factory_properties.get(
+ 'android_repo_resync_projects')
+ android_repo_branch = factory_properties.get('android_repo_branch')
+ android_ndk_pin_revision = factory_properties.get('android_ndk_pin_revision')
+
+ android_lunch_flavor = 'full-eng'
+ slave_android_root_name = 'android-src'
+ slave_android_build_path = api.slave_build_path(slave_android_root_name)
+ slave_android_out_path = api.slave_build_path(slave_android_root_name, 'out')
+ chromium_in_android_subpath = 'external/chromium_org'
+ slave_chromium_in_android_path = api.slave_build_path(
+ slave_android_root_name, chromium_in_android_subpath)
+ slave_repo_in_android_path = api.slave_build_path(slave_android_root_name,
+ '.repo', 'repo', 'repo')
+ slave_repo_copy_dir = api.slave_build_path('repo_copy')
+ slave_repo_copy_path = api.slave_build_path('repo_copy', 'repo')
+
+ steps = api.Steps(build_properties)
+
+ # This depends on __str__ being run delayed (at the time the command is about
+ # to be executred, not at the time the command stream is generated).
+ # TODO: better way?
iannucci 2013/05/09 21:13:38 *wistles*. Cool hax bro :D. Unfortunately, this
mkosiba (inactive) 2013/05/10 15:08:52 I was expecting more of a "omg, this is terrible"
+ class TrimmedDepsSpec(object):
+ def __init__(self):
+ pass
+
+ def __str__(self):
+ custom_deps = deps_blacklist(
+ api.slave_build_path('src', 'android_webview', 'buildbot',
+ 'deps_whitelist.py'),
+ api.slave_build_path('src', 'DEPS'))
+ trimmed_spec = {
+ 'solutions': [{
+ 'name' : 'src',
+ 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
+ 'safesync_url': '',
+ 'custom_deps': custom_deps,
+ }],
+ 'target_os': ['android'],
+ }
+ return json.dumps(trimmed_spec)
+
+ with_lunch_command = [api.slave_build_path('src', 'android_webview',
+ 'buildbot', 'with_lunch'),
+ slave_android_build_path,
+ android_lunch_flavor]
+
+ # For the android_webview AOSP build we want to only include whitelisted
+ # DEPS. This is to detect the addition of unexpected new deps to the webview.
+ spec = {
+ 'solutions': [{
+ 'name' : 'src',
+ 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
+ 'deps_file': '',
+ 'safesync_url': '',
+ }],
+ 'target_os': ['android'],
+ }
+
+ sync_with_trimmed_deps_step = [
+ steps.step('sync with trimmed deps', [
+ api.build_path('scripts', 'slave', 'annotated_checkout.py'),
+ '--type', 'gclient', '--spec', TrimmedDepsSpec()]),
+ ]
+
+ # The version of repo checked into depot_tools doesn't support switching
+ # between branches correctly due to
+ # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use
+ # the copy of repo from the Android tree.
+ # The copy of repo from depot_tools is only used to bootstrap the Android
+ # tree checkout.
+ repo_init_steps = []
+
+ repo_path = api.depot_tools_path('repo')
+ if os.path.exists(slave_repo_in_android_path):
+ repo_path = slave_repo_copy_path
+ if not os.path.exists(slave_repo_copy_dir):
+ repo_init_steps.append(
+ steps.step('mkdir repo copy dir',
+ ['mkdir', '-p', slave_repo_copy_dir]))
+ repo_init_steps.append(
+ steps.step('use repo from Android source tree', [
+ 'cp', slave_repo_in_android_path, slave_repo_copy_path]))
+
+ if not os.path.exists(slave_android_build_path):
+ repo_init_steps.append(
+ steps.step('mkdir android source root', [
+ 'mkdir', slave_android_root_name],
+ cwd=api.SLAVE_BUILD_ROOT))
+
+ # Piping through cat makes repo's check for running in a non-interactive
+ # environment succeed thus suppressing potential interactive prompts for user
+ # name and email.
+ repo_init_steps.append(
+ steps.step('repo init', [
+ repo_path,
+ 'init',
+ '-u', android_repo_url,
+ '-b', android_repo_branch],
+ pipes=[['cat']],
iannucci 2013/05/09 21:13:38 Ick. I think I'd (much) rather force ALL stdout fo
mkosiba (inactive) 2013/05/10 15:08:52 ah.. exciting news here - this was caused by the r
iannucci 2013/05/10 20:21:53 Ah, sweet! I should have remembered that. It woul
+ cwd=slave_android_build_path))
+
+ repo_sync_step = [
+ steps.step('repo sync',
+ [repo_path, 'sync'] + android_repo_sync_flags,
+ cwd=slave_android_build_path),
+ ]
+
+ local_manifest_ndk_pin_revision = []
+ if android_ndk_pin_revision:
+ local_manifest_ndk_pin_revision = ['--ndk-revision',
+ android_ndk_pin_revision]
+ generate_local_manifest_steps = [
+ steps.step('generate local manifest', [
+ api.slave_build_path(
+ 'src', 'android_webview', 'buildbot',
+ 'generate_local_manifest.py'),
+ slave_android_build_path, chromium_in_android_subpath] +
+ local_manifest_ndk_pin_revision),
+ steps.step('repo re-sync', [repo_path, 'sync', '-l'],
+ cwd=slave_android_build_path),
+ ]
+
+ # If the repo sync flag override specifies a smart sync manifest, then this
+ # makes it possible to sync specific projects past the smart sync manifest
+ # to the most up-to-date version.
+ android_repo_resync_projects_steps = []
+ if android_repo_resync_projects:
+ for project in android_repo_resync_projects:
+ android_repo_resync_projects_steps.append(
+ steps.step('repo re-sync project ' + project,
+ [repo_path, 'sync', project],
+ cwd=slave_android_build_path))
+
+
+ remove_potentially_stale_android_chromium_org_step = []
+ if os.path.exists(slave_chromium_in_android_path):
+ remove_potentially_stale_android_chromium_org_step = [
+ steps.step('remove potentially stale chromium_org',
+ ['rm', '-rf', slave_chromium_in_android_path]),
+ ]
+
+ symlink_chromium_into_android_tree_step = [
+ steps.step('symlink chromium source into android tree',
+ ['ln', '-s', api.slave_build_path('src'),
+ slave_chromium_in_android_path]),
+ ]
+
+ gyp_webview_step = [
+ steps.step('gyp_webview', with_lunch_command + [
+ api.slave_build_path(
+ slave_android_root_name, 'external', 'chromium_org',
+ 'android_webview', 'tools', 'gyp_webview')],
+ cwd=slave_chromium_in_android_path),
+ ]
+
+ # The Android.mk build system handles deps differently than the 'regular'
+ # Chromium makefiles which can lead to targets not being rebuilt.
+ # Fixing this is actually quite hard so we make this bot always clobber.
+ clobber_step = [
+ steps.step('clobber', ['rm', '-rf', slave_android_out_path + '/*']),
+ ]
+
+ compile_compiler_option = []
+ if os.path.exists(api.build_path('goma')):
+ compile_compiler_option = ['--compiler', 'goma',
+ '--goma-dir', api.build_path('goma')]
+ compile_step = [
+ steps.step('compile', with_lunch_command +
+ [api.build_path('scripts', 'slave', 'compile.py'),
+ 'libwebviewchromium', 'android_webview_java',
+ '--build-dir', api.slave_build_path(),
+ '--src-dir', slave_android_build_path,
+ '--target-output-dir', slave_android_out_path,
+ '--build-tool', 'make-android',
+ '--verbose'] + compile_compiler_option,
+ cwd=api.SLAVE_BUILD_ROOT),
+ ]
+
+ return {
+ 'checkout': 'gclient',
+ 'gclient_spec': spec,
+ 'steps': (
+ sync_with_trimmed_deps_step +
+ repo_init_steps +
+ repo_sync_step +
+ generate_local_manifest_steps +
+ android_repo_resync_projects_steps +
+ remove_potentially_stale_android_chromium_org_step +
+ symlink_chromium_into_android_tree_step +
+ gyp_webview_step +
+ clobber_step +
+ compile_step
+ ),
+ }
+
« no previous file with comments | « scripts/slave/compile.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698