| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 copy |
| 6 |
| 5 from slave import recipe_api | 7 from slave import recipe_api |
| 6 | 8 |
| 7 | 9 |
| 8 class iOSApi(recipe_api.RecipeApi): | 10 class iOSApi(recipe_api.RecipeApi): |
| 9 def __init__(self, *args, **kwargs): | 11 def __init__(self, *args, **kwargs): |
| 10 super(iOSApi, self).__init__(*args, **kwargs) | 12 super(iOSApi, self).__init__(*args, **kwargs) |
| 11 self.__config = None | 13 self.__config = None |
| 12 | 14 |
| 13 def host_info(self): | 15 def host_info(self): |
| 14 """Emits information about the current host and available tools.""" | 16 """Emits information about the current host and available tools.""" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 self.m.path['build'].join( | 117 self.m.path['build'].join( |
| 116 'scripts', | 118 'scripts', |
| 117 'slave', | 119 'slave', |
| 118 'ios', | 120 'ios', |
| 119 'find_xcode.py', | 121 'find_xcode.py', |
| 120 ), | 122 ), |
| 121 '--json-file', self.m.json.output(), | 123 '--json-file', self.m.json.output(), |
| 122 '--version', self.__config['xcode version'], | 124 '--version', self.__config['xcode version'], |
| 123 ], step_test_data=lambda: self.m.json.test_api.output({})) | 125 ], step_test_data=lambda: self.m.json.test_api.output({})) |
| 124 | 126 |
| 125 def build(self, official=False): | 127 cfg = self.m.chromium.make_config() |
| 128 cfg.gyp_env.GYP_DEFINES = copy.deepcopy( |
| 129 self.__config['GYP_DEFINES'] |
| 130 ) |
| 131 self.m.chromium.c = cfg |
| 132 |
| 133 def build(self): |
| 126 """Builds from this bot's build config.""" | 134 """Builds from this bot's build config.""" |
| 127 assert self.__config is not None | 135 assert self.__config is not None |
| 128 | 136 |
| 129 # Add the default GYP_DEFINES. | 137 # Add the default GYP_DEFINES. |
| 130 gyp_defines = [ | 138 gyp_defines = [ |
| 131 'component=static_library', | 139 'component=static_library', |
| 132 'OS=ios', | 140 'OS=ios', |
| 133 ] | 141 ] |
| 134 | 142 |
| 135 gyp_defines.extend( | 143 gyp_defines.extend( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 'device': 'iphoneos', | 172 'device': 'iphoneos', |
| 165 }[self.platform]) | 173 }[self.platform]) |
| 166 ) | 174 ) |
| 167 cmd = ['ninja', '-C', cwd] | 175 cmd = ['ninja', '-C', cwd] |
| 168 | 176 |
| 169 step_result = self.m.gclient.runhooks(env=env) | 177 step_result = self.m.gclient.runhooks(env=env) |
| 170 step_result.presentation.step_text = ( | 178 step_result.presentation.step_text = ( |
| 171 '<br />GYP_DEFINES:<br />%s' % '<br />'.join(gyp_defines) | 179 '<br />GYP_DEFINES:<br />%s' % '<br />'.join(gyp_defines) |
| 172 ) | 180 ) |
| 173 | 181 |
| 182 if self.compiler == 'ninja' and self.m.tryserver.is_tryserver: |
| 183 affected_files = self.m.tryserver.get_files_affected_by_patch() |
| 184 tests = [test['app'] for test in self.__config['tests']] |
| 185 |
| 186 self.m.chromium_tests.analyze( |
| 187 affected_files, |
| 188 tests, |
| 189 tests, |
| 190 'trybot_analyze_config.json', |
| 191 ) |
| 192 |
| 174 self.m.step('compile', cmd, cwd=cwd) | 193 self.m.step('compile', cmd, cwd=cwd) |
| 175 | 194 |
| 176 def test(self, *args): | 195 def test(self, *args): |
| 177 """Runs tests as instructed by this bot's build config. | 196 """Runs tests as instructed by this bot's build config. |
| 178 | 197 |
| 179 Args: | 198 Args: |
| 180 *args: Any additional arguments to pass to the test harness. | 199 *args: Any additional arguments to pass to the test harness. |
| 181 """ | 200 """ |
| 182 assert self.__config is not None | 201 assert self.__config is not None |
| 183 test_failures = [] | 202 test_failures = [] |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 self.configuration, | 328 self.configuration, |
| 310 'iossim', | 329 'iossim', |
| 311 ), | 330 ), |
| 312 'ninja': self.m.path.join( | 331 'ninja': self.m.path.join( |
| 313 'src', | 332 'src', |
| 314 build_dir, | 333 build_dir, |
| 315 '%s-%s' % (self.configuration, platform), | 334 '%s-%s' % (self.configuration, platform), |
| 316 'iossim', | 335 'iossim', |
| 317 ), | 336 ), |
| 318 }[self.compiler] | 337 }[self.compiler] |
| OLD | NEW |