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

Unified Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 24737002: Add Paths as first-class types in configs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipe_modules/chromium_android/api.py
diff --git a/scripts/slave/recipe_modules/chromium_android/api.py b/scripts/slave/recipe_modules/chromium_android/api.py
index cfa473186b29102389b87a9e486b93ec86292273..c87e10d378c0b39e60c610863ecc9d3b270fbfa5 100644
--- a/scripts/slave/recipe_modules/chromium_android/api.py
+++ b/scripts/slave/recipe_modules/chromium_android/api.py
@@ -8,20 +8,13 @@ class AndroidApi(recipe_api.RecipeApi):
def __init__(self, **kwargs):
super(AndroidApi, self).__init__(**kwargs)
self._env = dict()
- self._build_internal_android = None
self._internal_dir = None
def get_env(self):
env_dict = dict(self._env)
- for env_var, value in self.c.extra_env.iteritems():
- if isinstance(value, list):
- env_dict[env_var] = self.m.path.checkout(*value)
- else:
- env_dict[env_var] = value
- # TODO(sivachandra): Use os.pathsep equivalent instead of ':' when it
- # provided by one of the recipe modules.
+ env_dict.update(self.c.extra_env)
env_dict['PATH'] = self.m.path.pathsep.join(filter(bool, (
- self._build_internal_android,
+ str(self.c.build_internal_android),
self._env.get('PATH',''),
'%(PATH)s'
)))
@@ -37,7 +30,7 @@ class AndroidApi(recipe_api.RecipeApi):
gclient_custom_deps = self.m.properties.get('gclient_custom_deps')
if internal:
- self._internal_dir = repo_name.split('/', 1)[-1]
+ self._internal_dir = self.m.path.checkout(repo_name.split('/', 1)[-1])
self.set_config(bot_id,
INTERNAL=internal,
@@ -63,23 +56,14 @@ class AndroidApi(recipe_api.RecipeApi):
# TODO(sivachandra): Manufacture gclient spec such that it contains "src"
# solution + repo_name solution. Then checkout will be automatically
# correctly set by gclient.checkout
- manual_checkout_path = self.m.path.slave_build('src')
- self.m.path.add_checkout(manual_checkout_path)
- self.m.path.choose_checkout(manual_checkout_path)
-
- self._build_internal_android = self.m.path.build_internal(
- 'scripts', 'slave', 'android')
+ self.m.path.set_dynamic_path('checkout', self.m.path.slave_build('src'))
gyp_defs = self.m.chromium.c.gyp_env.GYP_DEFINES
- for gyp_def, val in gyp_defs.items():
- if isinstance(val, list):
- gyp_defs[gyp_def] = self.m.path.checkout(*val)
if internal:
yield self.m.step(
'get app_manifest_vars',
- [self.m.path.checkout(
- self._internal_dir, 'build', 'dump_app_manifest_vars.py'),
+ [self._internal_dir('build', 'dump_app_manifest_vars.py'),
'-b', self.m.properties['buildername'],
'-v', self.m.path.checkout('chrome', 'VERSION'),
'--output-json', self.m.json.output()]
@@ -125,7 +109,7 @@ class AndroidApi(recipe_api.RecipeApi):
args=[debug_info_dumps, test_logs, self.m.path.checkout()],
)
- def run_tree_truth(self, show_revisions=False):
+ def run_tree_truth(self):
# TODO(sivachandra): The downstream ToT builder will require
# 'Show Revisions' step.
repos = ['src', 'src-internal']
@@ -141,8 +125,8 @@ class AndroidApi(recipe_api.RecipeApi):
def runhooks(self):
run_hooks_env = self.get_env()
if self.m.properties.get('internal'):
- run_hooks_env['EXTRA_LANDMINES_SCRIPT'] = self.m.path.checkout(
- self._internal_dir, 'build', 'get_internal_landmines.py')
+ run_hooks_env['EXTRA_LANDMINES_SCRIPT'] = self._internal_dir(
+ 'build', 'get_internal_landmines.py')
return self.m.chromium.runhooks(env=run_hooks_env)
def apply_svn_patch(self):
@@ -154,15 +138,14 @@ class AndroidApi(recipe_api.RecipeApi):
'-p', self.m.properties['patch_url'],
'-r', self._internal_dir])
- def compile(self, target='Debug'):
+ def compile(self):
return self.m.chromium.compile(env=self.get_env())
def findbugs(self):
cmd = [self.m.path.checkout('build', 'android', 'findbugs_diff.py')]
if self.c.INTERNAL:
cmd.extend(
- ['-b',
- self.m.path.checkout(self._internal_dir, 'bin', 'findbugs_filter'),
+ ['-b', self._internal_dir('bin', 'findbugs_filter'),
'-o', 'com.google.android.apps.chrome.-,org.chromium.-'])
return self.m.step('findbugs internal', cmd, env=self.get_env())
@@ -177,5 +160,5 @@ class AndroidApi(recipe_api.RecipeApi):
if self.c.INTERNAL:
return self.m.step(
'lint',
- [self.m.path.checkout(self._internal_dir, 'bin', 'lint.py')],
+ [self._internal_dir('bin', 'lint.py')],
env=self.get_env())

Powered by Google App Engine
This is Rietveld 408576698