Chromium Code Reviews| 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 self.m.chromium.make_config().gyp_env.GYP_DEFINES = copy.deepcopy( |
|
Paweł Hajdan Jr.
2015/02/27 08:08:13
Could you replace "make_config()" with "c"? We use
smut
2015/02/27 19:09:06
Okay, I figured out the actual correct way to do t
| |
| 128 self.__config['GYP_DEFINES'] | |
| 129 ) | |
| 130 | |
| 131 def build(self): | |
| 126 """Builds from this bot's build config.""" | 132 """Builds from this bot's build config.""" |
| 127 assert self.__config is not None | 133 assert self.__config is not None |
| 128 | 134 |
| 129 # Add the default GYP_DEFINES. | 135 # Add the default GYP_DEFINES. |
| 130 gyp_defines = [ | 136 gyp_defines = [ |
| 131 'component=static_library', | 137 'component=static_library', |
| 132 'OS=ios', | 138 'OS=ios', |
| 133 ] | 139 ] |
| 134 | 140 |
| 135 gyp_defines.extend( | 141 gyp_defines.extend( |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 164 'device': 'iphoneos', | 170 'device': 'iphoneos', |
| 165 }[self.platform]) | 171 }[self.platform]) |
| 166 ) | 172 ) |
| 167 cmd = ['ninja', '-C', cwd] | 173 cmd = ['ninja', '-C', cwd] |
| 168 | 174 |
| 169 step_result = self.m.gclient.runhooks(env=env) | 175 step_result = self.m.gclient.runhooks(env=env) |
| 170 step_result.presentation.step_text = ( | 176 step_result.presentation.step_text = ( |
| 171 '<br />GYP_DEFINES:<br />%s' % '<br />'.join(gyp_defines) | 177 '<br />GYP_DEFINES:<br />%s' % '<br />'.join(gyp_defines) |
| 172 ) | 178 ) |
| 173 | 179 |
| 180 if self.compiler == 'ninja' and self.m.tryserver.is_tryserver: | |
| 181 tests = [test['app'] for test in self.__config['tests']] | |
| 182 self.m.chromium_tests.analyze(tests, tests, 'trybot_analyze_config.json') | |
| 183 | |
| 174 self.m.step('compile', cmd, cwd=cwd) | 184 self.m.step('compile', cmd, cwd=cwd) |
| 175 | 185 |
| 176 def test(self, *args): | 186 def test(self, *args): |
| 177 """Runs tests as instructed by this bot's build config. | 187 """Runs tests as instructed by this bot's build config. |
| 178 | 188 |
| 179 Args: | 189 Args: |
| 180 *args: Any additional arguments to pass to the test harness. | 190 *args: Any additional arguments to pass to the test harness. |
| 181 """ | 191 """ |
| 182 assert self.__config is not None | 192 assert self.__config is not None |
| 183 test_failures = [] | 193 test_failures = [] |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 self.configuration, | 319 self.configuration, |
| 310 'iossim', | 320 'iossim', |
| 311 ), | 321 ), |
| 312 'ninja': self.m.path.join( | 322 'ninja': self.m.path.join( |
| 313 'src', | 323 'src', |
| 314 build_dir, | 324 build_dir, |
| 315 '%s-%s' % (self.configuration, platform), | 325 '%s-%s' % (self.configuration, platform), |
| 316 'iossim', | 326 'iossim', |
| 317 ), | 327 ), |
| 318 }[self.compiler] | 328 }[self.compiler] |
| OLD | NEW |