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

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

Issue 2299973003: libyuv: refactor recipes (Closed)
Patch Set: Fixed some mistakes Created 4 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
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/libyuv/builders.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/recipe_modules/libyuv/api.py
diff --git a/scripts/slave/recipe_modules/libyuv/api.py b/scripts/slave/recipe_modules/libyuv/api.py
index 5f75018f3cf321196e8850820ea884a4ac983dda..59e960945955c2599ae39f2f2631f5247972eb74 100644
--- a/scripts/slave/recipe_modules/libyuv/api.py
+++ b/scripts/slave/recipe_modules/libyuv/api.py
@@ -3,7 +3,52 @@
# found in the LICENSE file.
from recipe_engine import recipe_api
+from . import builders
+
class LibyuvApi(recipe_api.RecipeApi):
+ BUILDERS = builders.BUILDERS
+ RECIPE_CONFIGS = builders.RECIPE_CONFIGS
+
def __init__(self, **kwargs):
super(LibyuvApi, self).__init__(**kwargs)
+
+
+ def apply_bot_config(self, builders, recipe_configs, perf_config=None):
+ mastername = self.m.properties.get('mastername')
+ buildername = self.m.properties.get('buildername')
+ master_dict = builders.get(mastername, {})
+
+ self.bot_config = master_dict.get('builders', {}).get(buildername)
+ assert self.bot_config, ('Unrecognized builder name "%r" for master "%r".' %
+ (buildername, mastername))
+
+ self.bot_type = self.bot_config['bot_type']
+ recipe_config_name = self.bot_config['recipe_config']
+ self.recipe_config = recipe_configs.get(recipe_config_name)
+ assert self.recipe_config, (
+ 'Cannot find recipe_config "%s" for builder "%r".' %
+ (recipe_config_name, buildername))
+
+ chromium_kwargs = self.bot_config.get('chromium_config_kwargs', {})
+
+ self.m.chromium.set_config(self.recipe_config['chromium_config'],
+ **chromium_kwargs)
+ self.m.gclient.set_config(self.recipe_config['gclient_config'])
+
+ # Support applying configs both at the bot and the recipe config level.
+ for c in self.bot_config.get('chromium_apply_config', []):
+ self.m.chromium.apply_config(c)
+ for c in self.bot_config.get('gclient_apply_config', []):
+ self.m.gclient.apply_config(c)
+
+ if self.m.tryserver.is_tryserver:
+ self.m.chromium.apply_config('trybot_flavor')
+
+ @property
+ def should_build(self):
+ return self.bot_type in ('builder', 'builder_tester')
+
+ @property
+ def should_test(self):
+ return self.bot_type in ('tester', 'builder_tester')
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/libyuv/builders.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698