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

Side by Side 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: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/slave/recipe_util.py ('k') | scripts/slave/recipes_test/android_webview_aosp.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 def GetSteps(api, factory_properties, build_properties):
6 android_lunch_flavor = factory_properties.get('android_lunch_flavor',
7 'full-eng')
8 android_ndk_pin_revision = factory_properties.get('android_ndk_pin_revision')
9 android_repo_url = factory_properties.get('android_repo_url')
10 android_repo_sync_flags = factory_properties.get('android_repo_sync_flags',
11 ['-j16', '-d', '-f'])
12 android_repo_resync_projects = factory_properties.get(
13 'android_repo_resync_projects')
14 android_repo_branch = factory_properties.get('android_repo_branch')
15
16 slave_android_root_name = 'android-src'
17 slave_android_build_path = api.slave_build_path(slave_android_root_name)
18 slave_android_out_path = api.slave_build_path(slave_android_root_name, 'out')
19 chromium_in_android_subpath = 'external/chromium_org'
20 slave_chromium_in_android_path = api.slave_build_path(
21 slave_android_root_name, chromium_in_android_subpath)
22 slave_repo_in_android_path = api.slave_build_path(slave_android_root_name,
23 '.repo', 'repo', 'repo')
24 slave_repo_copy_dir = api.slave_build_path('repo_copy')
25 slave_repo_copy_path = api.slave_build_path('repo_copy', 'repo')
26
27 steps = api.Steps(build_properties)
28
29 # Some commands need to be run after lunch has been executed to set up the
30 # Android-specific environment variables.
31 with_lunch_command = [api.build_path('scripts', 'slave', 'android',
32 'with_lunch'),
33 slave_android_build_path,
34 android_lunch_flavor]
35
36 # In order to get at the DEPS whitelist file we first need a bare checkout.
37 bare_chromium_spec = {'solutions': [
38 {
39 'name': 'src',
40 'url': steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
41 'deps_file': '',
42 'managed': True,
43 'safesync_url': '',
44 }]}
45 sync_chromium_bare_step = steps.gclient_checkout(bare_chromium_spec,
46 spec_name='bare')
47
48 # For the android_webview AOSP build we want to only include whitelisted
49 # DEPS. This is to detect the addition of unexpected new deps to the webview.
50 calculate_trimmed_deps_step_name = 'calculate trimmed deps'
51 calculate_trimmed_deps_step = steps.step(
52 calculate_trimmed_deps_step_name,
53 [api.checkout_path('android_webview', 'buildbot', 'deps_whitelist.py'),
54 '--method', 'android_build',
55 '--path-to-deps', api.checkout_path('DEPS'),
56 ],
57 add_json_output=True)
58
59 def sync_chromium_with_trimmed_deps_step(step_history, _failure):
60 deps_blacklist_step = step_history[calculate_trimmed_deps_step_name]
61 deps_blacklist = deps_blacklist_step.json_data['blacklist']
62 trimmed_chromium_spec = {
63 'solutions': [{
64 'name' : 'src',
65 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
66 'safesync_url': '',
67 'custom_deps': deps_blacklist,
68 }],
69 'target_os': ['android'],
70 }
71 yield steps.gclient_checkout(trimmed_chromium_spec, spec_name='trimmed')
72
73 # The version of repo checked into depot_tools doesn't support switching
74 # between branches correctly due to
75 # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use
76 # the copy of repo from the Android tree.
77 # The copy of repo from depot_tools is only used to bootstrap the Android
78 # tree checkout.
79 repo_init_steps = []
80
81 repo_path = api.depot_tools_path('repo')
82 if api.path_exists(slave_repo_in_android_path):
83 repo_path = slave_repo_copy_path
84 if not api.path_exists(slave_repo_copy_dir):
85 repo_init_steps.append(
86 steps.step('mkdir repo copy dir',
87 ['mkdir', '-p', slave_repo_copy_dir]))
88 repo_init_steps.append(
89 steps.step('copy repo from Android', [
90 'cp', slave_repo_in_android_path, slave_repo_copy_path]))
91
92 if not api.path_exists(slave_android_build_path):
93 repo_init_steps.append(
94 steps.step('mkdir android source root', [
95 'mkdir', slave_android_build_path]))
96
97 repo_init_steps.append(
98 steps.step('repo init', [
99 repo_path,
100 'init',
101 '-u', android_repo_url,
102 '-b', android_repo_branch],
103 cwd=slave_android_build_path))
104
105 local_manifest_ndk_pin_revision = []
106 if android_ndk_pin_revision:
107 local_manifest_ndk_pin_revision = ['--ndk-revision',
108 android_ndk_pin_revision]
109 generate_local_manifest_step = steps.step(
110 'generate local manifest', [
111 api.checkout_path('android_webview', 'buildbot',
112 'generate_local_manifest.py'),
113 slave_android_build_path, chromium_in_android_subpath] +
114 local_manifest_ndk_pin_revision)
115
116 repo_sync_step = steps.step('repo sync',
117 [repo_path, 'sync'] + android_repo_sync_flags,
118 cwd=slave_android_build_path),
119
120 # If the repo sync flag override specifies a smart sync manifest, then this
121 # makes it possible to sync specific projects past the smart sync manifest
122 # to the most up-to-date version.
123 android_repo_resync_projects_steps = []
124 if android_repo_resync_projects:
125 for project in android_repo_resync_projects:
126 android_repo_resync_projects_steps.append(
127 steps.step('repo re-sync project ' + project,
128 [repo_path, 'sync', project],
129 cwd=slave_android_build_path))
130
131 remove_potentially_stale_android_chromium_org_step = []
132 if api.path_exists(slave_chromium_in_android_path):
133 remove_potentially_stale_android_chromium_org_step = [
134 steps.step('remove chromium_org',
135 ['rm', '-rf', slave_chromium_in_android_path]),
136 ]
137
138 symlink_chromium_into_android_tree_step = [
139 steps.step('symlink chromium_org',
140 ['ln', '-s', api.checkout_path(),
141 slave_chromium_in_android_path]),
142 ]
143
144 gyp_webview_step = [
145 steps.step('gyp_webview', with_lunch_command + [
146 api.slave_build_path(
147 slave_android_root_name, 'external', 'chromium_org',
148 'android_webview', 'tools', 'gyp_webview')],
149 cwd=slave_chromium_in_android_path),
150 ]
151
152 compile_compiler_options = []
153 if api.path_exists(api.build_path('goma')):
154 compile_compiler_options = ['--compiler', 'goma',
155 '--goma-dir', api.build_path('goma')]
156 compile_step = [
157 steps.step('compile', with_lunch_command +
158 [api.build_path('scripts', 'slave', 'compile.py'),
159 'libwebviewchromium', 'android_webview_java',
160 '--build-dir', api.slave_build_path(),
161 '--src-dir', slave_android_build_path,
162 '--target-output-dir', slave_android_out_path,
163 '--build-tool', 'make-android',
164 '--verbose'] + compile_compiler_options,
165 cwd=api.SLAVE_BUILD_ROOT),
166 ]
167
168 return (
169 sync_chromium_bare_step,
170 calculate_trimmed_deps_step,
171 sync_chromium_with_trimmed_deps_step,
172 repo_init_steps,
173 generate_local_manifest_step,
174 repo_sync_step,
175 android_repo_resync_projects_steps,
176 remove_potentially_stale_android_chromium_org_step,
177 symlink_chromium_into_android_tree_step,
178 gyp_webview_step,
179 compile_step
180 )
OLDNEW
« no previous file with comments | « scripts/slave/recipe_util.py ('k') | scripts/slave/recipes_test/android_webview_aosp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698