OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """MB - the Meta-Build wrapper around GYP and GN | 6 """MB - the Meta-Build wrapper around GYP and GN |
7 | 7 |
8 MB is a wrapper script for GYP and GN that can be used to generate build files | 8 MB is a wrapper script for GYP and GN that can be used to generate build files |
9 for sets of canned configurations and analyze them. | 9 for sets of canned configurations and analyze them. |
10 """ | 10 """ |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 if not sub_mixin in self.mixins: | 298 if not sub_mixin in self.mixins: |
299 errs.append('Unknown mixin "%s" referenced by mixin "%s".' % | 299 errs.append('Unknown mixin "%s" referenced by mixin "%s".' % |
300 (sub_mixin, mixin)) | 300 (sub_mixin, mixin)) |
301 referenced_mixins.add(sub_mixin) | 301 referenced_mixins.add(sub_mixin) |
302 | 302 |
303 # Check that every mixin defined is actually referenced somewhere. | 303 # Check that every mixin defined is actually referenced somewhere. |
304 for mixin in self.mixins: | 304 for mixin in self.mixins: |
305 if not mixin in referenced_mixins: | 305 if not mixin in referenced_mixins: |
306 errs.append('Unreferenced mixin "%s".' % mixin) | 306 errs.append('Unreferenced mixin "%s".' % mixin) |
307 | 307 |
308 # Check that 'chromium' bots which build public artifacts do not include | |
309 # the chrome_with_codecs 'mixin'. | |
310 if not 'chromium' in self.masters: | |
311 errs.append('Missing "chromium" master. Please update this proprietary ' | |
kjellander_chromium
2016/03/15 03:54:59
In WebRTC, we have own mb_config.pyl for the stand
| |
312 'codecs check with the name of the master responsible for ' | |
313 'public build artifacts.') | |
314 else: | |
315 for builder in self.masters['chromium']: | |
316 config = self.masters['chromium'][builder] | |
317 def RecurseMixins(current_mixin): | |
318 if current_mixin == 'chrome_with_codecs': | |
319 errs.append('Public artifact builder "%s" can not contain the ' | |
320 '"chrome_with_codecs" mixin.' % builder) | |
321 return | |
322 if not 'mixins' in self.mixins[current_mixin]: | |
323 return | |
324 for mixin in self.mixins[current_mixin]['mixins']: | |
325 RecurseMixins(mixin) | |
326 | |
327 for mixin in self.configs[config]: | |
328 RecurseMixins(mixin) | |
329 | |
308 if errs: | 330 if errs: |
309 raise MBErr(('mb config file %s has problems:' % self.args.config_file) + | 331 raise MBErr(('mb config file %s has problems:' % self.args.config_file) + |
310 '\n ' + '\n '.join(errs)) | 332 '\n ' + '\n '.join(errs)) |
311 | 333 |
312 self.Print('mb config file %s looks ok.' % self.args.config_file) | 334 self.Print('mb config file %s looks ok.' % self.args.config_file) |
313 return 0 | 335 return 0 |
314 | 336 |
315 def GetConfig(self): | 337 def GetConfig(self): |
316 build_dir = self.args.path[0] | 338 build_dir = self.args.path[0] |
317 | 339 |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1155 | 1177 |
1156 if __name__ == '__main__': | 1178 if __name__ == '__main__': |
1157 try: | 1179 try: |
1158 sys.exit(main(sys.argv[1:])) | 1180 sys.exit(main(sys.argv[1:])) |
1159 except MBErr as e: | 1181 except MBErr as e: |
1160 print(e) | 1182 print(e) |
1161 sys.exit(1) | 1183 sys.exit(1) |
1162 except KeyboardInterrupt: | 1184 except KeyboardInterrupt: |
1163 print("interrupted, exiting", stream=sys.stderr) | 1185 print("interrupted, exiting", stream=sys.stderr) |
1164 sys.exit(130) | 1186 sys.exit(130) |
OLD | NEW |