| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 | 6 |
| 7 from slave import recipe_api | 7 from slave import recipe_api |
| 8 | 8 |
| 9 class AndroidApi(recipe_api.RecipeApi): | 9 class AndroidApi(recipe_api.RecipeApi): |
| 10 def __init__(self, **kwargs): | 10 def __init__(self, **kwargs): |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 [self.m.path['build'].join('scripts', 'slave', 'apply_svn_patch.py'), | 193 [self.m.path['build'].join('scripts', 'slave', 'apply_svn_patch.py'), |
| 194 '-p', self.m.properties['patch_url'], | 194 '-p', self.m.properties['patch_url'], |
| 195 '-r', self.internal_dir]) | 195 '-r', self.internal_dir]) |
| 196 | 196 |
| 197 def compile(self, **kwargs): | 197 def compile(self, **kwargs): |
| 198 assert 'env' not in kwargs, ( | 198 assert 'env' not in kwargs, ( |
| 199 "chromium_andoid compile clobbers env in keyword arguments") | 199 "chromium_andoid compile clobbers env in keyword arguments") |
| 200 kwargs['env'] = self.get_env() | 200 kwargs['env'] = self.get_env() |
| 201 return self.m.chromium.compile(**kwargs) | 201 return self.m.chromium.compile(**kwargs) |
| 202 | 202 |
| 203 def findbugs(self): |
| 204 cmd = [self.m.path['checkout'].join('build', 'android', 'findbugs_diff.py')] |
| 205 if self.m.chromium.c.BUILD_CONFIG == 'Release': |
| 206 cmd.append('--release-build') |
| 207 yield self.m.step('findbugs', cmd, env=self.get_env()) |
| 208 |
| 209 # If findbugs fails, there could be stale class files. Delete them, and |
| 210 # next run maybe we'll do better. |
| 211 if self.m.step_history.last_step().retcode != 0: |
| 212 yield self.m.path.rmwildcard( |
| 213 '*.class', |
| 214 self.m.path['checkout'].join('out'), |
| 215 always_run=True) |
| 216 |
| 217 cmd = [self.m.path['checkout'].join('tools', 'android', 'findbugs_plugin', |
| 218 'test', 'run_findbugs_plugin_tests.py')] |
| 219 if self.m.chromium.c.BUILD_CONFIG == 'Release': |
| 220 cmd.append('--release-build') |
| 221 yield self.m.step('findbugs_tests', cmd, env=self.get_env()) |
| 222 |
| 223 def checklicenses(self): |
| 224 yield self.m.step( |
| 225 'check_licenses', |
| 226 [self.m.path['checkout'].join('android_webview', 'tools', |
| 227 'webview_licenses.py'), |
| 228 'scan'], |
| 229 env=self.get_env()) |
| 230 |
| 203 def git_number(self): | 231 def git_number(self): |
| 204 yield self.m.step( | 232 yield self.m.step( |
| 205 'git_number', | 233 'git_number', |
| 206 [self.m.path['depot_tools'].join('git_number.py')], | 234 [self.m.path['depot_tools'].join('git_number.py')], |
| 207 stdout = self.m.raw_io.output(), | 235 stdout = self.m.raw_io.output(), |
| 208 step_test_data=( | 236 step_test_data=( |
| 209 lambda: | 237 lambda: |
| 210 self.m.raw_io.test_api.stream_output('3000\n') | 238 self.m.raw_io.test_api.stream_output('3000\n') |
| 211 ), | 239 ), |
| 212 cwd=self.m.path['checkout']) | 240 cwd=self.m.path['checkout']) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 291 |
| 264 | 292 |
| 265 def spawn_logcat_monitor(self): | 293 def spawn_logcat_monitor(self): |
| 266 return self.m.step( | 294 return self.m.step( |
| 267 'spawn_logcat_monitor', | 295 'spawn_logcat_monitor', |
| 268 [self.m.path['build'].join('scripts', 'slave', 'daemonizer.py'), | 296 [self.m.path['build'].join('scripts', 'slave', 'daemonizer.py'), |
| 269 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'), | 297 '--', self.c.cr_build_android.join('adb_logcat_monitor.py'), |
| 270 self.m.chromium.c.build_dir.join('logcat')], | 298 self.m.chromium.c.build_dir.join('logcat')], |
| 271 env=self.get_env(), can_fail_build=False) | 299 env=self.get_env(), can_fail_build=False) |
| 272 | 300 |
| 273 def device_status_check(self, restart_usb=False): | 301 def device_status_check(self, restart_usb=False, **kwargs): |
| 274 def followup_fn(step_result): | 302 def followup_fn(step_result): |
| 275 if not step_result.retcode == 0: | 303 if not step_result.retcode == 0: |
| 276 step_result.presentation.links.update({ | 304 step_result.presentation.links.update({ |
| 277 'report a bug': ('https://code.google.com/p/chromium/issues/entry?' + | 305 'report a bug': ('https://code.google.com/p/chromium/issues/entry?' + |
| 278 ('summary=Device Offline&comment=Buildbot: %s%%0ABuild%%3A' % | 306 ('summary=Device Offline&comment=Buildbot: %s%%0ABuild%%3A' % |
| 279 self.m.properties['buildername']) + | 307 self.m.properties['buildername']) + |
| 280 (' %s%%0A(please don\'t change' % self.m.properties['buildnumber']) + | 308 (' %s%%0A(please don\'t change' % self.m.properties['buildnumber']) + |
| 281 ' any labels)&labels=Restrict-View-Google,OS-Android,Infra') | 309 ' any labels)&labels=Restrict-View-Google,OS-Android,Infra') |
| 282 }) | 310 }) |
| 283 | 311 |
| 284 args = [] | 312 args = [] |
| 285 if restart_usb: | 313 if restart_usb: |
| 286 args = ['--restart-usb'] | 314 args = ['--restart-usb'] |
| 287 yield self.m.step( | 315 yield self.m.step( |
| 288 'device_status_check', | 316 'device_status_check', |
| 289 [self.m.path['checkout'].join('build', 'android', 'buildbot', | 317 [self.m.path['checkout'].join('build', 'android', 'buildbot', |
| 290 'bb_device_status_check.py')] + args, | 318 'bb_device_status_check.py')] + args, |
| 291 env=self.get_env(), | 319 env=self.get_env(), |
| 292 followup_fn=followup_fn) | 320 followup_fn=followup_fn, |
| 321 **kwargs) |
| 293 | 322 |
| 294 def provision_devices(self): | 323 def provision_devices(self, **kwargs): |
| 295 yield self.m.python( | 324 yield self.m.python( |
| 296 'provision_devices', | 325 'provision_devices', |
| 297 self.m.path['checkout'].join( | 326 self.m.path['checkout'].join( |
| 298 'build', 'android', 'provision_devices.py'), | 327 'build', 'android', 'provision_devices.py'), |
| 299 args=['-t', self.m.chromium.c.BUILD_CONFIG], | 328 args=['-t', self.m.chromium.c.BUILD_CONFIG], |
| 300 can_fail_build=False) | 329 can_fail_build=False, |
| 330 **kwargs) |
| 301 | 331 |
| 302 def detect_and_setup_devices(self): | 332 def detect_and_setup_devices(self): |
| 303 yield self.device_status_check() | 333 yield self.device_status_check() |
| 304 yield self.provision_devices() | 334 yield self.provision_devices() |
| 305 | 335 |
| 306 if self.c.INTERNAL: | 336 if self.c.INTERNAL: |
| 307 yield self.m.step( | 337 yield self.m.step( |
| 308 'setup_devices_for_testing', | 338 'setup_devices_for_testing', |
| 309 [self.internal_dir.join('build', 'setup_device_testing.py')], | 339 [self.internal_dir.join('build', 'setup_device_testing.py')], |
| 310 env=self.get_env(), can_fail_build=False) | 340 env=self.get_env(), can_fail_build=False) |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 | 577 |
| 548 yield self.m.gsutil.upload( | 578 yield self.m.gsutil.upload( |
| 549 source=self.coverage_dir.join('coverage_html'), | 579 source=self.coverage_dir.join('coverage_html'), |
| 550 bucket='chrome-code-coverage', | 580 bucket='chrome-code-coverage', |
| 551 dest=gs_dest, | 581 dest=gs_dest, |
| 552 args=['-R'], | 582 args=['-R'], |
| 553 name='upload coverage report', | 583 name='upload coverage report', |
| 554 link_name='Coverage report', | 584 link_name='Coverage report', |
| 555 always_run=True, | 585 always_run=True, |
| 556 **kwargs) | 586 **kwargs) |
| OLD | NEW |