Chromium Code Reviews| Index: tools/mb/mb.py |
| diff --git a/tools/mb/mb.py b/tools/mb/mb.py |
| index b733345166d1dab5010805d2139a19707641cd37..23125c83fde9a5c4b7a8721d4f27f3836a9d546c 100755 |
| --- a/tools/mb/mb.py |
| +++ b/tools/mb/mb.py |
| @@ -344,13 +344,15 @@ class MetaBuildWrapper(object): |
| } |
| def Lookup(self): |
| - self.ReadConfigFile() |
| - config = self.ConfigFromArgs() |
| - if not config in self.configs: |
| - raise MBErr('Config "%s" not found in %s' % |
| - (config, self.args.config_file)) |
| + vals = self.ReadBotConfig() |
| + if not vals: |
| + self.ReadConfigFile() |
| + config = self.ConfigFromArgs() |
| + if not config in self.configs: |
| + raise MBErr('Config "%s" not found in %s' % |
| + (config, self.args.config_file)) |
| - vals = self.FlattenConfig(config) |
| + vals = self.FlattenConfig(config) |
| # Do some basic sanity checking on the config so that we |
| # don't have to do this in every caller. |
| @@ -360,6 +362,29 @@ class MetaBuildWrapper(object): |
| return vals |
| + def ReadBotConfig(self): |
| + if not self.args.master or not self.args.builder: |
| + return {} |
| + path = self.PathJoin(self.chromium_src_dir, 'ios', 'build', 'bots', |
| + self.args.master, |
| + self.args.builder.replace(' ', '_') + '.json') |
|
smut
2015/11/18 22:00:29
Shouldn't need this. The recipes read the builder
Dirk Pranke
2015/11/18 22:30:27
Ah, you're right. That's an unorthodox naming sche
|
| + if not self.Exists(path): |
| + return {} |
| + |
| + contents = json.loads(self.ReadFile(path)) |
| + gyp_vals = contents.get('GYP_DEFINES', {}) |
| + if isinstance(gyp_vals, dict): |
| + gyp_defines = ' '.join('%s=%s' % (k, v) for k, v in gyp_vals.items()) |
| + else: |
| + gyp_defines = ' '.join(gyp_vals) |
| + gn_args = ' '.join(contents.get('gn_args', [])) |
| + |
| + return { |
| + 'type': contents.get('mb_type', ''), |
| + 'gn_args': gn_args, |
| + 'gyp_defines': gyp_defines, |
| + } |
| + |
| def ReadConfigFile(self): |
| if not self.Exists(self.args.config_file): |
| raise MBErr('config file not found at %s' % self.args.config_file) |