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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/base_android/api.py
diff --git a/scripts/slave/recipe_modules/base_android/api.py b/scripts/slave/recipe_modules/base_android/api.py
new file mode 100644
index 0000000000000000000000000000000000000000..68b006fbcdb3cace5e440141d4faf78bb5850c05
--- /dev/null
+++ b/scripts/slave/recipe_modules/base_android/api.py
@@ -0,0 +1,45 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from slave import recipe_api
+
+class BaseAndroidApi(recipe_api.RecipeApi):
+ def __init__(self, **kwargs):
+ super(BaseAndroidApi, self).__init__(**kwargs)
+ self._env = {}
+
+ def envsetup(self):
+ """Use envsetup.sh to read environment variables to use for Android.
+
+ This environment will be used for runhooks, compile and test_runner with the
+ exception for the GYP_* variables, which are excluded to avoid confusion
+ with settings in the chromium recipe module config.
+ """
+ envsetup_cmd = [self.m.path.checkout('build', 'android', 'envsetup.sh')]
+ 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.
+ envsetup_cmd += ['--target-arch=x86']
+
+ cmd = ([self.m.path.build('scripts', 'slave', 'env_dump.py'),
+ '--output-json', self.m.json.output()] + envsetup_cmd)
+ yield self.m.step('envsetup', cmd, env=self._env)
+
+ env_diff = self.m.step_history.last_step().json.output
+ 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.
+ if key.startswith('GYP_'):
+ continue
+ else:
+ self._env[key] = value
+
+ def runhooks(self):
+ return self.m.chromium.runhooks(env=self._env)
+
+ def compile(self):
+ return self.m.chromium.compile(env=self._env)
+
+ def test_runner(self, test):
+ script = self.m.path.checkout('build', 'android', 'test_runner.py')
+ args = ['gtest', '-s', test, '--verbose']
+ if self.m.chromium.c.BUILD_CONFIG == 'Release':
+ args += ['--release']
+ return self.m.python(test, script, args, env=self._env)

Powered by Google App Engine
This is Rietveld 408576698