Chromium Code Reviews| 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') |
|
kjellander_chromium
2016/09/01 11:52:20
This is mostly a slimmed down version copied from
|
| + 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') |