Chromium Code Reviews| Index: tools/mb/mb.py |
| diff --git a/tools/mb/mb.py b/tools/mb/mb.py |
| index 1a693535f5e684d7353757ba21ad90ed94d6a497..221167c5abf347bbea92c2415324b4e9d8d0feb0 100755 |
| --- a/tools/mb/mb.py |
| +++ b/tools/mb/mb.py |
| @@ -315,11 +315,15 @@ class MetaBuildWrapper(object): |
| all_configs = {} |
| for master in self.masters: |
| for config in self.masters[master].values(): |
| - all_configs[config] = master |
| + all_configs[config] = master |
|
perezju
2016/04/12 10:40:53
nit: I think this line shouldn't change
Dirk Pranke
2016/04/12 15:15:45
You're right.
|
| - # Check that every referenced config actually exists. |
| + # Check that every referenced args file or config actually exists. |
| for config, loc in all_configs.items(): |
| - if not config in self.configs: |
| + if config.startswith('//'): |
| + if not self.Exists(self.ToAbsPath(config)): |
| + errs.append('Unknown args file "%s" referenced from "%s".' % |
| + (config, loc)) |
| + elif not config in self.configs: |
| errs.append('Unknown config "%s" referenced from "%s".' % |
| (config, loc)) |
| @@ -550,11 +554,19 @@ class MetaBuildWrapper(object): |
| 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) |
| + if config.startswith('//'): |
| + if not self.Exists(self.ToAbsPath(config)): |
| + raise MBErr('args file "%s" not found' % config) |
| + vals = { |
| + 'type': 'gn', |
| + 'args_file': config, |
| + 'gn_args': '', |
| + } |
| + else: |
| + if not config in self.configs: |
| + raise MBErr('Config "%s" not found in %s' % |
| + (config, self.args.config_file)) |
| + vals = self.FlattenConfig(config) |
| # Do some basic sanity checking on the config so that we |
| # don't have to do this in every caller. |
| @@ -873,6 +885,9 @@ class MetaBuildWrapper(object): |
| # the last instance of each arg is listed. |
| gn_args = gn_helpers.ToGNString(gn_helpers.FromGNArgs(gn_args)) |
| + args_file = vals.get('args_file', None) |
| + if args_file: |
| + gn_args = ('import("%s")\n' % vals['args_file']) + gn_args |
| return gn_args |
| def RunGYPGen(self, vals): |