| 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 recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
| 8 from recipe_engine import util as recipe_util | 8 from recipe_engine import util as recipe_util |
| 9 | 9 |
| 10 from . import builders | |
| 11 from . import steps | |
| 12 | |
| 13 class TestLauncherFilterFileInputPlaceholder(recipe_util.Placeholder): | 10 class TestLauncherFilterFileInputPlaceholder(recipe_util.Placeholder): |
| 14 def __init__(self, api, tests): | 11 def __init__(self, api, tests): |
| 15 self.raw = api.m.raw_io.input('\n'.join(tests)) | 12 self.raw = api.m.raw_io.input('\n'.join(tests)) |
| 16 super(TestLauncherFilterFileInputPlaceholder, self).__init__() | 13 super(TestLauncherFilterFileInputPlaceholder, self).__init__() |
| 17 | 14 |
| 18 def render(self, test): | 15 def render(self, test): |
| 19 result = self.raw.render(test) | 16 result = self.raw.render(test) |
| 20 if not test.enabled: # pragma: no cover | 17 if not test.enabled: # pragma: no cover |
| 21 result[0] = '--test-launcher-filter-file=%s' % result[0] | 18 result[0] = '--test-launcher-filter-file=%s' % result[0] |
| 22 return result | 19 return result |
| 23 | 20 |
| 24 def result(self, presentation, test): | 21 def result(self, presentation, test): |
| 25 return self.raw.result(presentation, test) | 22 return self.raw.result(presentation, test) |
| 26 | 23 |
| 27 | 24 |
| 28 class ChromiumApi(recipe_api.RecipeApi): | 25 class ChromiumApi(recipe_api.RecipeApi): |
| 29 def __init__(self, *args, **kwargs): | 26 def __init__(self, *args, **kwargs): |
| 30 super(ChromiumApi, self).__init__(*args, **kwargs) | 27 super(ChromiumApi, self).__init__(*args, **kwargs) |
| 31 self._build_properties = None | 28 self._build_properties = None |
| 32 self._builders = {} | 29 self._builders = {} |
| 33 self.add_builders(builders.BUILDERS) | |
| 34 | 30 |
| 35 def get_config_defaults(self): | 31 def get_config_defaults(self): |
| 36 return { | 32 return { |
| 37 'HOST_PLATFORM': self.m.platform.name, | 33 'HOST_PLATFORM': self.m.platform.name, |
| 38 'HOST_ARCH': self.m.platform.arch, | 34 'HOST_ARCH': self.m.platform.arch, |
| 39 'HOST_BITS': self.m.platform.bits, | 35 'HOST_BITS': self.m.platform.bits, |
| 40 | 36 |
| 41 'TARGET_PLATFORM': self.m.platform.name, | 37 'TARGET_PLATFORM': self.m.platform.name, |
| 42 'TARGET_ARCH': self.m.platform.arch, | 38 'TARGET_ARCH': self.m.platform.arch, |
| 43 'TARGET_CROS_BOARD': None, | 39 'TARGET_CROS_BOARD': None, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS | 62 ret['ADB_VENDOR_KEYS'] = self.c.env.ADB_VENDOR_KEYS |
| 67 if self.c.env.LLVM_FORCE_HEAD_REVISION: | 63 if self.c.env.LLVM_FORCE_HEAD_REVISION: |
| 68 ret['LLVM_FORCE_HEAD_REVISION'] = self.c.env.LLVM_FORCE_HEAD_REVISION | 64 ret['LLVM_FORCE_HEAD_REVISION'] = self.c.env.LLVM_FORCE_HEAD_REVISION |
| 69 return ret | 65 return ret |
| 70 | 66 |
| 71 @property | 67 @property |
| 72 def builders(self): | 68 def builders(self): |
| 73 return self._builders | 69 return self._builders |
| 74 | 70 |
| 75 @property | 71 @property |
| 76 def steps(self): | |
| 77 return steps | |
| 78 | |
| 79 @property | |
| 80 def build_properties(self): | 72 def build_properties(self): |
| 81 return self._build_properties | 73 return self._build_properties |
| 82 | 74 |
| 83 @property | 75 @property |
| 84 def output_dir(self): | 76 def output_dir(self): |
| 85 """Return the path to the built executable directory.""" | 77 """Return the path to the built executable directory.""" |
| 86 return self.c.build_dir.join(self.c.build_config_fs) | 78 return self.c.build_dir.join(self.c.build_config_fs) |
| 87 | 79 |
| 88 @property | 80 @property |
| 89 def version(self): | 81 def version(self): |
| (...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 '--output', self.m.json.output(), | 755 '--output', self.m.json.output(), |
| 764 '--', | 756 '--', |
| 765 ] + self.get_common_args_for_scripts(), | 757 ] + self.get_common_args_for_scripts(), |
| 766 step_test_data=lambda: self.m.json.test_api.output({})) | 758 step_test_data=lambda: self.m.json.test_api.output({})) |
| 767 | 759 |
| 768 def download_lto_plugin(self): | 760 def download_lto_plugin(self): |
| 769 return self.m.python( | 761 return self.m.python( |
| 770 name='download LTO plugin', | 762 name='download LTO plugin', |
| 771 script=self.m.path['checkout'].join( | 763 script=self.m.path['checkout'].join( |
| 772 'build', 'download_gold_plugin.py')) | 764 'build', 'download_gold_plugin.py')) |
| OLD | NEW |