OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 import re | 5 import re |
6 | 6 |
7 from slave import recipe_api | 7 from slave import recipe_api |
8 from slave import recipe_util | 8 from slave import recipe_util |
9 | 9 |
10 from . import builders | 10 from . import builders |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 | 697 |
698 args.extend(['--build-config-fs', self.c.build_config_fs]) | 698 args.extend(['--build-config-fs', self.c.build_config_fs]) |
699 | 699 |
700 paths = {} | 700 paths = {} |
701 for path in ('build', 'checkout'): | 701 for path in ('build', 'checkout'): |
702 paths[path] = self.m.path[path] | 702 paths[path] = self.m.path[path] |
703 args.extend(['--paths', self.m.json.input(paths)]) | 703 args.extend(['--paths', self.m.json.input(paths)]) |
704 | 704 |
705 properties = {} | 705 properties = {} |
706 # TODO(phajdan.jr): Remove buildnumber when no longer used. | 706 # TODO(phajdan.jr): Remove buildnumber when no longer used. |
707 for name in ('buildername', 'slavename', 'buildnumber'): | 707 |
708 mastername = self.m.properties.get('mastername') | |
709 buildername = self.m.properties.get('buildername') | |
710 master_dict = self.builders.get(mastername, {}) | |
711 bot_config = master_dict.get('builders', {}).get(buildername, {}) | |
712 | |
713 for name in ('buildername', 'slavename', 'buildnumber', 'mastername'): | |
708 properties[name] = self.m.properties[name] | 714 properties[name] = self.m.properties[name] |
715 | |
716 # Optional properties | |
717 for name, value in bot_config.get('optional_properties', {}).iteritems(): | |
Paweł Hajdan Jr.
2015/01/30 21:20:30
I think allowing per-builder optional properties w
shatch
2015/02/09 21:23:59
Done.
| |
718 properties[name] = value | |
719 | |
709 args.extend(['--properties', self.m.json.input(properties)]) | 720 args.extend(['--properties', self.m.json.input(properties)]) |
710 | 721 |
711 return args | 722 return args |
712 | 723 |
713 def get_compile_targets_for_scripts(self): | 724 def get_compile_targets_for_scripts(self): |
714 return self.m.python( | 725 return self.m.python( |
715 name='get compile targets for scripts', | 726 name='get compile targets for scripts', |
716 script=self.m.path['checkout'].join( | 727 script=self.m.path['checkout'].join( |
717 'testing', 'scripts', 'get_compile_targets.py'), | 728 'testing', 'scripts', 'get_compile_targets.py'), |
718 args=[ | 729 args=[ |
719 '--output', self.m.json.output(), | 730 '--output', self.m.json.output(), |
720 '--', | 731 '--', |
721 ] + self.get_common_args_for_scripts(), | 732 ] + self.get_common_args_for_scripts(), |
722 step_test_data=lambda: self.m.json.test_api.output({})) | 733 step_test_data=lambda: self.m.json.test_api.output({})) |
OLD | NEW |