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

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: remove the need for passing input into repo init 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
« scripts/slave/recipe_util.py ('K') | « scripts/slave/recipe_util.py ('k') | no next file » | 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 import os
6
7 try:
8 import json # pylint: disable=F0401
9 except ImportError:
10 import simplejson as json
11
12 def deps_blacklist(path_to_whitelist_script, path_to_deps_file):
13 local_vars = {}
14 execfile(path_to_whitelist_script, {'os': os}, local_vars)
15 deps_whitelist = local_vars['DepsWhitelist']()
16 return deps_whitelist.get_aosp_bot_deps_blacklist(path_to_deps_file)
17
18 def GetFactoryProperties(api, factory_properties, build_properties):
19 android_repo_url = factory_properties.get('android_repo_url')
20 android_repo_sync_flags = factory_properties.get('android_repo_sync_flags',
21 ['-j16', '-d', '-f'])
22 android_repo_resync_projects = factory_properties.get(
23 'android_repo_resync_projects')
24 android_repo_branch = factory_properties.get('android_repo_branch')
25 android_ndk_pin_revision = factory_properties.get('android_ndk_pin_revision')
26
27 android_lunch_flavor = 'full-eng'
28 slave_android_root_name = 'android-src'
29 slave_android_build_path = api.slave_build_path(slave_android_root_name)
30 slave_android_out_path = api.slave_build_path(slave_android_root_name, 'out')
31 chromium_in_android_subpath = 'external/chromium_org'
32 slave_chromium_in_android_path = api.slave_build_path(
33 slave_android_root_name, chromium_in_android_subpath)
34 slave_repo_in_android_path = api.slave_build_path(slave_android_root_name,
35 '.repo', 'repo', 'repo')
36 slave_repo_copy_dir = api.slave_build_path('repo_copy')
37 slave_repo_copy_path = api.slave_build_path('repo_copy', 'repo')
38
39 steps = api.Steps(build_properties)
40
41 # This depends on __str__ being run delayed (at the time the command is about
42 # to be executred, not at the time the command stream is generated).
43 # TODO: better way?
44 class TrimmedDepsSpec(object):
45 def __init__(self):
46 pass
47
48 def __str__(self):
49 custom_deps = deps_blacklist(
50 api.slave_build_path('src', 'android_webview', 'buildbot',
51 'deps_whitelist.py'),
52 api.slave_build_path('src', 'DEPS'))
53 trimmed_spec = {
54 'solutions': [{
55 'name' : 'src',
56 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
57 'safesync_url': '',
58 'custom_deps': custom_deps,
59 }],
60 'target_os': ['android'],
61 }
62 return json.dumps(trimmed_spec)
63
64 with_lunch_command = [api.slave_build_path('src', 'android_webview',
65 'buildbot', 'with_lunch'),
66 slave_android_build_path,
67 android_lunch_flavor]
68
69 # For the android_webview AOSP build we want to only include whitelisted
70 # DEPS. This is to detect the addition of unexpected new deps to the webview.
71 spec = {
72 'solutions': [{
73 'name' : 'src',
74 'url' : steps.ChromiumSvnURL('chrome', 'trunk', 'src'),
75 'deps_file': '',
76 'safesync_url': '',
77 }],
78 'target_os': ['android'],
79 }
80
81 sync_with_trimmed_deps_step = [
82 steps.step('sync with trimmed deps', [
83 api.build_path('scripts', 'slave', 'annotated_checkout.py'),
84 '--type', 'gclient', '--spec', TrimmedDepsSpec()]),
85 ]
86
87 # The version of repo checked into depot_tools doesn't support switching
88 # between branches correctly due to
89 # https://code.google.com/p/git-repo/issues/detail?id=46 which is why we use
90 # the copy of repo from the Android tree.
91 # The copy of repo from depot_tools is only used to bootstrap the Android
92 # tree checkout.
93 repo_init_step = []
agable 2013/05/07 23:10:18 repo_init_steps
94
95 repo_path = api.depot_tools_path('repo')
96 if os.path.exists(slave_repo_in_android_path):
97 repo_path = slave_repo_copy_path
98 if not os.path.exists(slave_repo_copy_dir):
99 repo_init_step.append(
100 steps.step('mkdir repo copy dir',
101 ['mkdir', '-p', slave_repo_copy_dir]))
102 repo_init_step.append(
103 steps.step('use repo from Android source tree', [
104 'cp', slave_repo_in_android_path, slave_repo_copy_path]))
105
106 if not os.path.exists(slave_android_build_path):
107 repo_init_step.append(
108 steps.step('mkdir android source root', [
109 'mkdir', slave_android_root_name],
110 cwd=api.SLAVE_BUILD_ROOT))
111
112 # This is required so that repo init doesn't hang the build by interactively
113 # asking for the user name or email.
114 repo_init_step.extend([
115 steps.git_step('config', '--global', 'user.name', 'buildbot'),
116 steps.git_step('config', '--global', 'user.email', 'chrome-bot@google.com'),
agable 2013/05/07 23:10:18 These are a bad idea. Ideally, recipes can and wil
mkosiba (inactive) 2013/05/08 10:07:00 ok. I assumed this would be better than piping "\n
117 steps.git_step('config', '--global', 'color.ui', 'false'),
118 ])
119
120 repo_init_step.append(
121 steps.step('repo init', [
122 repo_path,
123 'init',
124 '-u', android_repo_url,
125 '-b', android_repo_branch],
126 cwd=slave_android_build_path))
127
128 repo_sync_step = [
129 steps.step('repo sync',
130 [repo_path, 'sync'] + android_repo_sync_flags,
131 cwd=slave_android_build_path),
132 ]
133
134 local_manifest_ndk_pin_revision = []
135 if android_ndk_pin_revision:
136 local_manifest_ndk_pin_revision = ['--ndk-revision',
137 android_ndk_pin_revision]
138 generate_local_manifest_step = [
139 steps.step('generate local manifest', [
140 api.slave_build_path(
141 'src', 'android_webview', 'buildbot',
142 'generate_local_manifest.py'),
143 slave_android_build_path, chromium_in_android_subpath] +
144 local_manifest_ndk_pin_revision),
145 steps.step('repo re-sync', [repo_path, 'sync', '-l'],
146 cwd=slave_android_build_path),
147 ]
148
149 # If the repo sync flag override specifies a smart sync manifest, then this
150 # makes it possible to sync specific projects past the smart sync manifest
151 # to the most up-to-date version.
152 android_repo_resync_projects_step = []
153 if android_repo_resync_projects:
154 for project in android_repo_resync_projects:
155 android_repo_resync_projects_step.append(
156 steps.step('repo re-sync project ' + project,
157 [repo_path, 'sync', project],
158 cwd=slave_android_build_path))
159
160
161 remove_potentially_stale_android_chromium_org = []
162 if os.path.exists(slave_chromium_in_android_path):
163 remove_potentially_stale_android_chromium_org = [
164 steps.step('remove potentially stale chromium_org',
165 ['rm', '-rf', slave_chromium_in_android_path]),
166 ]
167
168 symlink_chromium_into_android_tree_step = [
169 steps.step('symlink chromium source into android tree',
170 ['ln', '-s', api.slave_build_path('src'),
171 slave_chromium_in_android_path]),
172 ]
173
174 gyp_webview_step = [
175 steps.step('gyp_webview', with_lunch_command + [
176 api.slave_build_path(
177 slave_android_root_name, 'external', 'chromium_org',
178 'android_webview', 'tools', 'gyp_webview')],
179 cwd=slave_chromium_in_android_path),
180 ]
181
182 # The Android.mk build system handles deps differently than the 'regular'
183 # Chromium makefiles which can lead to targets not being rebuilt.
184 # Fixing this is actually quite hard so we make this bot always clobber.
185 clobber_step = [
186 steps.step('clobber', ['rm', '-rf', slave_android_out_path + '/*']),
187 ]
188
189 compile_compiler_option = []
190 if os.path.exists(api.build_path('goma')):
191 compile_compiler_option = ['--compiler', 'goma',
192 '--goma-dir', api.build_path('goma')]
193 compile_step = [
194 steps.step('compile', with_lunch_command +
195 [api.build_path('scripts', 'slave', 'compile.py'),
196 'libwebviewchromium', 'android_webview_java',
197 '--build-dir', api.slave_build_path(),
198 '--src-dir', slave_android_build_path,
199 '--target-output-dir', slave_android_out_path,
200 '--build-tool', 'make-android',
201 '--verbose'] + compile_compiler_option,
202 cwd=api.SLAVE_BUILD_ROOT),
203 ]
204
205 return {
206 'checkout': 'gclient',
207 'gclient_spec': spec,
208 'steps': (
209 sync_with_trimmed_deps_step +
210 repo_init_step +
211 repo_sync_step + generate_local_manifest_step +
212 remove_potentially_stale_android_chromium_org +
213 symlink_chromium_into_android_tree_step +
214 gyp_webview_step +
215 clobber_step +
216 compile_step
217 ),
218 }
219
OLDNEW
« scripts/slave/recipe_util.py ('K') | « scripts/slave/recipe_util.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698