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 | 5 import copy |
| 6 | 6 |
| 7 from recipe_engine import recipe_api | 7 from recipe_engine import recipe_api |
| 8 | 8 |
| 9 | 9 |
| 10 class iOSApi(recipe_api.RecipeApi): | 10 class iOSApi(recipe_api.RecipeApi): |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 self.package_repo_resource( | 206 self.package_repo_resource( |
| 207 'scripts', 'slave', 'ios', 'find_xcode.py'), | 207 'scripts', 'slave', 'ios', 'find_xcode.py'), |
| 208 '--json-file', self.m.json.output(), | 208 '--json-file', self.m.json.output(), |
| 209 '--version', self.__config['xcode version'], | 209 '--version', self.__config['xcode version'], |
| 210 ], step_test_data=lambda: self.m.json.test_api.output({})) | 210 ], step_test_data=lambda: self.m.json.test_api.output({})) |
| 211 | 211 |
| 212 cfg = self.m.chromium.make_config() | 212 cfg = self.m.chromium.make_config() |
| 213 | 213 |
| 214 if self.using_gyp: | 214 if self.using_gyp: |
| 215 cfg.gyp_env.GYP_CROSSCOMPILE = 1 | 215 cfg.gyp_env.GYP_CROSSCOMPILE = 1 |
| 216 cfg.gyp_env.GYP_DEFINES = copy.deepcopy(self.__config['GYP_DEFINES']) | 216 if isinstance(self.__config['GYP_DEFINES'], dict): |
| 217 cfg.gyp_env.GYP_DEFINES = copy.deepcopy(self.__config['GYP_DEFINES']) | |
| 218 else: | |
| 219 cfg.gyp_env.GYP_DEFINES = dict(v.split('=') for | |
| 220 v in self.__config['GYP_DEFINES']) | |
| 217 self.m.chromium.c = cfg | 221 self.m.chromium.c = cfg |
| 218 | 222 |
| 223 use_goma = (self.compiler == 'ninja' and | |
| 224 (cfg.gyp_env.GYP_DEFINES.get('goma') == '1' or | |
| 225 'use_goma=true' in self.__config['gn_args'])) | |
| 226 if use_goma: | |
|
smut
2016/07/07 22:58:28
Do we need the "if 'without patch' not in suffix"
Dirk Pranke
2016/07/07 23:05:36
This block is moved from build() to read_build_con
| |
| 227 # Make sure these chromium configs are applied consistently for the | |
| 228 # rest of the recipe. | |
|
Dirk Pranke
2016/07/07 23:05:36
These are needed for m.chromium.compile() to work
| |
| 229 self.m.chromium.apply_config('ninja') | |
| 230 self.m.chromium.apply_config('default_compiler') | |
| 231 self.m.chromium.apply_config('goma') | |
| 232 | |
| 233 # Calling ensure_goma() after apply_config('goma') make sure that | |
| 234 # we gett the right c.compile_py.goma_dir . | |
|
smut
2016/07/07 22:58:28
s/gett/get/
Dirk Pranke
2016/07/07 23:05:58
Done.
| |
| 235 self.m.chromium.ensure_goma() | |
| 236 | |
| 219 def build(self, mb_config_path=None, suffix=None): | 237 def build(self, mb_config_path=None, suffix=None): |
| 220 """Builds from this bot's build config.""" | 238 """Builds from this bot's build config.""" |
| 221 assert self.__config is not None | 239 assert self.__config is not None |
| 222 | 240 |
| 223 suffix = ' (%s)' % suffix if suffix else '' | 241 suffix = ' (%s)' % suffix if suffix else '' |
| 224 | 242 |
| 225 if self.using_mb: | 243 if self.using_mb: |
| 226 self.m.chromium.c.project_generator.tool = 'mb' | 244 self.m.chromium.c.project_generator.tool = 'mb' |
| 227 | 245 |
| 228 # Add the default GYP_DEFINES. | 246 # Add the default GYP_DEFINES. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 test['skip'] = True | 337 test['skip'] = True |
| 320 | 338 |
| 321 if compile_targets: # pragma: no cover | 339 if compile_targets: # pragma: no cover |
| 322 cmd.extend(compile_targets) | 340 cmd.extend(compile_targets) |
| 323 else: | 341 else: |
| 324 return | 342 return |
| 325 | 343 |
| 326 use_goma = (self.compiler == 'ninja' and | 344 use_goma = (self.compiler == 'ninja' and |
| 327 ('use_goma=1' in gyp_defines or 'use_goma=true' in gn_args)) | 345 ('use_goma=1' in gyp_defines or 'use_goma=true' in gn_args)) |
| 328 if use_goma: | 346 if use_goma: |
| 329 if 'without patch' not in suffix: | |
| 330 # TODO(crbug.com/603641): | |
| 331 # Configs aren't deapplied, so we only want to apply these | |
| 332 # configs once. Really, we should refactor this so that we're | |
| 333 # not applying configs at all in build(), but rather do it | |
| 334 # in an earlier step. | |
| 335 self.m.chromium.apply_config('ninja') | |
| 336 self.m.chromium.apply_config('default_compiler') | |
| 337 self.m.chromium.apply_config('goma') | |
| 338 self.m.chromium.compile(targets=compile_targets, | 347 self.m.chromium.compile(targets=compile_targets, |
| 339 target=build_sub_path, | 348 target=build_sub_path, |
| 340 cwd=cwd) | 349 cwd=cwd) |
| 341 else: | 350 else: |
| 342 self.m.step('compile' + suffix, cmd, cwd=cwd) | 351 self.m.step('compile' + suffix, cmd, cwd=cwd) |
| 343 | 352 |
| 344 def test(self, *args): | 353 def test(self, *args): |
| 345 """Runs tests as instructed by this bot's build config. | 354 """Runs tests as instructed by this bot's build config. |
| 346 | 355 |
| 347 Args: | 356 Args: |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 486 self.configuration, | 495 self.configuration, |
| 487 'iossim', | 496 'iossim', |
| 488 ), | 497 ), |
| 489 'ninja': self.m.path.join( | 498 'ninja': self.m.path.join( |
| 490 'src', | 499 'src', |
| 491 build_dir, | 500 build_dir, |
| 492 '%s-%s' % (self.configuration, platform), | 501 '%s-%s' % (self.configuration, platform), |
| 493 'iossim', | 502 'iossim', |
| 494 ), | 503 ), |
| 495 }[self.compiler] | 504 }[self.compiler] |
| OLD | NEW |