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

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: 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')
agable 2013/05/22 17:21:23 android-src/.repo/repo/repo? man, our paths are ri
mkosiba (inactive) 2013/05/23 13:13:38 agreed :)
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('use repo from Android source tree', [
agable 2013/05/22 17:21:23 This step name doesn't match your others. Maybe 'c
mkosiba (inactive) 2013/05/23 13:13:38 Done.
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_steps = [
110 steps.step('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 steps.step('repo re-sync', [repo_path, 'sync', '-l'],
116 cwd=slave_android_build_path),
117 ]
118
119 repo_sync_step = [
agable 2013/05/22 17:21:23 repo re-sync followed immediately by repo sync is
mkosiba (inactive) 2013/05/23 13:13:38 good spot! I actually reshuffled the steps so that
120 steps.step('repo sync',
121 [repo_path, 'sync'] + android_repo_sync_flags,
122 cwd=slave_android_build_path),
123 ]
124
125 # If the repo sync flag override specifies a smart sync manifest, then this
126 # makes it possible to sync specific projects past the smart sync manifest
127 # to the most up-to-date version.
128 android_repo_resync_projects_steps = []
129 if android_repo_resync_projects:
130 for project in android_repo_resync_projects:
131 android_repo_resync_projects_steps.append(
132 steps.step('repo re-sync project ' + project,
133 [repo_path, 'sync', project],
134 cwd=slave_android_build_path))
135
136 remove_potentially_stale_android_chromium_org_step = []
137 if api.path_exists(slave_chromium_in_android_path):
138 remove_potentially_stale_android_chromium_org_step = [
139 steps.step('remove potentially stale chromium_org',
agable 2013/05/22 17:21:23 This step only exists of chromium_org does, so doe
mkosiba (inactive) 2013/05/23 13:13:38 Done.
140 ['rm', '-rf', slave_chromium_in_android_path]),
141 ]
142
143 symlink_chromium_into_android_tree_step = [
144 steps.step('symlink chromium source into android tree',
agable 2013/05/22 17:21:23 Same here.
mkosiba (inactive) 2013/05/23 13:13:38 Done.
145 ['ln', '-s', api.checkout_path(),
146 slave_chromium_in_android_path]),
147 ]
148
149 gyp_webview_step = [
150 steps.step('gyp_webview', with_lunch_command + [
151 api.slave_build_path(
152 slave_android_root_name, 'external', 'chromium_org',
153 'android_webview', 'tools', 'gyp_webview')],
154 cwd=slave_chromium_in_android_path),
155 ]
156
157 # The Android.mk build system handles deps differently than the 'regular'
158 # Chromium makefiles which can lead to targets not being rebuilt.
159 # Fixing this is actually quite hard so we make this bot always clobber.
160 clobber_step = [
161 steps.step('clobber', ['rm', '-rf', slave_android_out_path]),
agable 2013/05/22 17:21:23 What's the difference between this clobber and the
mkosiba (inactive) 2013/05/23 13:13:38 Done.
162 ]
163
164 compile_compiler_option = []
agable 2013/05/22 17:21:23 ..._options
mkosiba (inactive) 2013/05/23 13:13:38 Done.
165 if api.path_exists(api.build_path('goma')):
166 compile_compiler_option = ['--compiler', 'goma',
167 '--goma-dir', api.build_path('goma')]
168 compile_step = [
169 steps.step('compile', with_lunch_command +
170 [api.build_path('scripts', 'slave', 'compile.py'),
171 'libwebviewchromium', 'android_webview_java',
172 '--build-dir', api.slave_build_path(),
173 '--src-dir', slave_android_build_path,
174 '--target-output-dir', slave_android_out_path,
175 '--build-tool', 'make-android',
176 '--verbose'] + compile_compiler_option,
177 cwd=api.SLAVE_BUILD_ROOT),
178 ]
179
180 return (
181 sync_chromium_bare_step,
182 calculate_trimmed_deps_step,
183 sync_chromium_with_trimmed_deps_step,
184 repo_init_steps,
185 repo_sync_step,
186 generate_local_manifest_steps,
187 android_repo_resync_projects_steps,
188 remove_potentially_stale_android_chromium_org_step,
189 symlink_chromium_into_android_tree_step,
190 gyp_webview_step,
191 clobber_step,
192 compile_step
193 )
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698