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

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 on top of CL 15270004 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 unified diff | Download patch | Annotate | Revision Log
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
46 # For the android_webview AOSP build we want to only include whitelisted
47 # DEPS. This is to detect the addition of unexpected new deps to the webview.
48 calculate_trimmed_deps_step_name = 'calculate trimmed deps'
49 calculate_trimmed_deps_step = steps.step(
50 calculate_trimmed_deps_step_name,
51 [api.build_path('scripts', 'slave', 'android',
52 'generate_whitelist_deps_step.py'),
53 '--method', 'get_deps_for_android_build',
54 '--path-to-deps', api.checkout_path('DEPS'),
55 '--path-to-whitelist',
56 api.checkout_path('android_webview', 'buildbot', 'deps_whitelist.py')
57 ],
58 add_json_output=True)
59
60 def sync_chromium_with_trimmed_deps_step(step_history, _failure):
61 deps_blacklist_step = step_history[calculate_trimmed_deps_step_name]
62 deps_blacklist = deps_blacklist_step.json_data['blacklist']
63 trimmed_chromium_spec = {
64 'solutions': [{
65 'name' : 'src',
66 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
67 'safesync_url': '',
68 'custom_deps': deps_blacklist,
69 }],
70 'target_os': ['android'],
71 }
72 yield steps.gclient_checkout(trimmed_chromium_spec, spec_name='trimmed')
73
74 # The version of repo checked into depot_tools doesn't support switching
75 # between branches correctly due to
76 # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use
77 # the copy of repo from the Android tree.
78 # The copy of repo from depot_tools is only used to bootstrap the Android
79 # tree checkout.
80 repo_init_steps = []
81
82 repo_path = api.depot_tools_path('repo')
83 if api.path_exists(slave_repo_in_android_path):
84 repo_path = slave_repo_copy_path
85 if not api.path_exists(slave_repo_copy_dir):
86 repo_init_steps.append(
87 steps.step('mkdir repo copy dir',
88 ['mkdir', '-p', slave_repo_copy_dir]))
89 repo_init_steps.append(
90 steps.step('use repo from Android source tree', [
91 'cp', slave_repo_in_android_path, slave_repo_copy_path]))
92
93 if not api.path_exists(slave_android_build_path):
94 repo_init_steps.append(
95 steps.step('mkdir android source root', [
96 'mkdir', slave_android_build_path]))
97
98 repo_init_steps.append(
99 steps.step('repo init', [
100 repo_path,
101 'init',
102 '-u', android_repo_url,
103 '-b', android_repo_branch],
104 cwd=slave_android_build_path))
105
106 local_manifest_ndk_pin_revision = []
107 if android_ndk_pin_revision:
108 local_manifest_ndk_pin_revision = ['--ndk-revision',
109 android_ndk_pin_revision]
110 generate_local_manifest_steps = [
111 steps.step('generate local manifest', [
112 api.checkout_path('android_webview', 'buildbot',
113 'generate_local_manifest.py'),
114 slave_android_build_path, chromium_in_android_subpath] +
115 local_manifest_ndk_pin_revision),
116 steps.step('repo re-sync', [repo_path, 'sync', '-l'],
117 cwd=slave_android_build_path),
118 ]
119
120 repo_sync_step = [
121 steps.step('repo sync',
122 [repo_path, 'sync'] + android_repo_sync_flags,
123 cwd=slave_android_build_path),
124 ]
125
126 # If the repo sync flag override specifies a smart sync manifest, then this
127 # makes it possible to sync specific projects past the smart sync manifest
128 # to the most up-to-date version.
129 android_repo_resync_projects_steps = []
130 if android_repo_resync_projects:
131 for project in android_repo_resync_projects:
132 android_repo_resync_projects_steps.append(
133 steps.step('repo re-sync project ' + project,
134 [repo_path, 'sync', project],
135 cwd=slave_android_build_path))
136
137 remove_potentially_stale_android_chromium_org_step = []
138 if api.path_exists(slave_chromium_in_android_path):
139 remove_potentially_stale_android_chromium_org_step = [
140 steps.step('remove potentially stale chromium_org',
141 ['rm', '-rf', slave_chromium_in_android_path]),
142 ]
143
144 symlink_chromium_into_android_tree_step = [
145 steps.step('symlink chromium source into android tree',
146 ['ln', '-s', api.checkout_path(),
147 slave_chromium_in_android_path]),
148 ]
149
150 gyp_webview_step = [
151 steps.step('gyp_webview', with_lunch_command + [
152 api.slave_build_path(
153 slave_android_root_name, 'external', 'chromium_org',
154 'android_webview', 'tools', 'gyp_webview')],
155 cwd=slave_chromium_in_android_path),
156 ]
157
158 # The Android.mk build system handles deps differently than the 'regular'
159 # Chromium makefiles which can lead to targets not being rebuilt.
160 # Fixing this is actually quite hard so we make this bot always clobber.
161 clobber_step = [
162 steps.step('clobber', ['rm', '-rf', slave_android_out_path + '/*']),
163 ]
164
165 compile_compiler_option = []
166 if api.path_exists(api.build_path('goma')):
167 compile_compiler_option = ['--compiler', 'goma',
168 '--goma-dir', api.build_path('goma')]
169 compile_step = [
170 steps.step('compile', with_lunch_command +
171 [api.build_path('scripts', 'slave', 'compile.py'),
172 'libwebviewchromium', 'android_webview_java',
173 '--build-dir', api.slave_build_path(),
174 '--src-dir', slave_android_build_path,
175 '--target-output-dir', slave_android_out_path,
176 '--build-tool', 'make-android',
177 '--verbose'] + compile_compiler_option,
178 cwd=api.SLAVE_BUILD_ROOT),
179 ]
180
181 return (
182 steps.gclient_checkout(bare_chromium_spec, spec_name='bare'),
183 calculate_trimmed_deps_step,
184 sync_chromium_with_trimmed_deps_step,
185 repo_init_steps,
186 repo_sync_step,
187 generate_local_manifest_steps,
188 android_repo_resync_projects_steps,
189 remove_potentially_stale_android_chromium_org_step,
190 symlink_chromium_into_android_tree_step,
191 gyp_webview_step,
192 clobber_step,
193 compile_step
194 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698