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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/libyuv/builders.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from recipe_engine import recipe_api 5 from recipe_engine import recipe_api
6 from . import builders
7
6 8
7 class LibyuvApi(recipe_api.RecipeApi): 9 class LibyuvApi(recipe_api.RecipeApi):
10 BUILDERS = builders.BUILDERS
11 RECIPE_CONFIGS = builders.RECIPE_CONFIGS
12
8 def __init__(self, **kwargs): 13 def __init__(self, **kwargs):
9 super(LibyuvApi, self).__init__(**kwargs) 14 super(LibyuvApi, self).__init__(**kwargs)
15
16
17 def apply_bot_config(self, builders, recipe_configs, perf_config=None):
18 mastername = self.m.properties.get('mastername')
19 buildername = self.m.properties.get('buildername')
20 master_dict = builders.get(mastername, {})
21
22 self.bot_config = master_dict.get('builders', {}).get(buildername)
23 assert self.bot_config, ('Unrecognized builder name "%r" for master "%r".' %
24 (buildername, mastername))
25
26 self.bot_type = self.bot_config['bot_type']
27 recipe_config_name = self.bot_config['recipe_config']
28 self.recipe_config = recipe_configs.get(recipe_config_name)
29 assert self.recipe_config, (
30 'Cannot find recipe_config "%s" for builder "%r".' %
31 (recipe_config_name, buildername))
32
33 chromium_kwargs = self.bot_config.get('chromium_config_kwargs', {})
34
35 self.m.chromium.set_config(self.recipe_config['chromium_config'],
36 **chromium_kwargs)
37 self.m.gclient.set_config(self.recipe_config['gclient_config'])
38
39 # Support applying configs both at the bot and the recipe config level.
40 for c in self.bot_config.get('chromium_apply_config', []):
41 self.m.chromium.apply_config(c)
42 for c in self.bot_config.get('gclient_apply_config', []):
43 self.m.gclient.apply_config(c)
44
45 if self.m.tryserver.is_tryserver:
46 self.m.chromium.apply_config('trybot_flavor')
47
48 @property
49 def should_build(self):
50 return self.bot_type in ('builder', 'builder_tester')
51
52 @property
53 def should_test(self):
54 return self.bot_type in ('tester', 'builder_tester')
OLDNEW
« 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