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

Side by Side Diff: scripts/slave/recipe_modules/base_android/api.py

Issue 75163006: WebRTC Android APK trybot recipe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Addressed comments and refactored Created 7 years, 1 month 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 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 from slave import recipe_api
6
7 class BaseAndroidApi(recipe_api.RecipeApi):
8 def __init__(self, **kwargs):
9 super(BaseAndroidApi, self).__init__(**kwargs)
10 self._env = {}
11
12 def envsetup(self):
13 """Use envsetup.sh to read environment variables to use for Android.
14
15 This environment will be used for runhooks, compile and test_runner with the
16 exception for the GYP_* variables, which are excluded to avoid confusion
17 with settings in the chromium recipe module config.
18 """
19 envsetup_cmd = [self.m.path.checkout('build', 'android', 'envsetup.sh')]
20 if self.m.chromium.c.TARGET_ARCH == 'intel':
iannucci 2013/11/21 00:33:59 I would add a @property to this class which conver
kjellander_chromium 2013/11/22 12:49:09 Done.
21 envsetup_cmd += ['--target-arch=x86']
22
23 cmd = ([self.m.path.build('scripts', 'slave', 'env_dump.py'),
24 '--output-json', self.m.json.output()] + envsetup_cmd)
25 yield self.m.step('envsetup', cmd, env=self._env)
26
27 env_diff = self.m.step_history.last_step().json.output
28 for key, value in env_diff.iteritems():
M-A Ruel 2013/11/20 14:37:37 What you want is: self._env.update((k, v) for k, v
iannucci 2013/11/21 00:33:59 +1 I think it just needs to be an iterable of pai
kjellander_chromium 2013/11/22 12:49:09 Done.
29 if key.startswith('GYP_'):
30 continue
31 else:
32 self._env[key] = value
33
34 def runhooks(self):
35 return self.m.chromium.runhooks(env=self._env)
36
37 def compile(self):
38 return self.m.chromium.compile(env=self._env)
39
40 def test_runner(self, test):
41 script = self.m.path.checkout('build', 'android', 'test_runner.py')
42 args = ['gtest', '-s', test, '--verbose']
43 if self.m.chromium.c.BUILD_CONFIG == 'Release':
44 args += ['--release']
45 return self.m.python(test, script, args, env=self._env)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698