| 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 from slave.recipe_configs_util import config_item_context, ConfigGroup | 5 from slave.recipe_configs_util import config_item_context, ConfigGroup |
| 6 from slave.recipe_configs_util import DictConfig, SimpleConfig, StaticConfig | 6 from slave.recipe_configs_util import DictConfig, SimpleConfig, StaticConfig |
| 7 from slave.recipe_configs_util import SetConfig, BadConf | 7 from slave.recipe_configs_util import SetConfig, BadConf |
| 8 | 8 |
| 9 # Because of the way that we use decorators, pylint can't figure out the proper | 9 # Because of the way that we use decorators, pylint can't figure out the proper |
| 10 # type signature of functions annotated with the @config_ctx decorator. | 10 # type signature of functions annotated with the @config_ctx decorator. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 return 'Debug' if build_config == 'Debug' else 'Release' | 55 return 'Debug' if build_config == 'Debug' else 'Release' |
| 56 | 56 |
| 57 # Because bits and arch actually accept None as a valid parameter, | 57 # Because bits and arch actually accept None as a valid parameter, |
| 58 # give them a means of distinguishing when they've been passed a default | 58 # give them a means of distinguishing when they've been passed a default |
| 59 # argument v. None | 59 # argument v. None |
| 60 HostPlatformValue = object() | 60 HostPlatformValue = object() |
| 61 | 61 |
| 62 # Schema for config items in this module. | 62 # Schema for config items in this module. |
| 63 def BaseConfig(HOST_PLATFORM=None, HOST_ARCH=None, HOST_BITS=None, | 63 def BaseConfig(HOST_PLATFORM=None, HOST_ARCH=None, HOST_BITS=None, |
| 64 TARGET_PLATFORM=None, TARGET_ARCH=HostPlatformValue, | 64 TARGET_PLATFORM=None, TARGET_ARCH=HostPlatformValue, |
| 65 TARGET_BITS=HostPlatformValue, BUILD_CONFIG=norm_build_config()): | 65 TARGET_BITS=HostPlatformValue, BUILD_CONFIG=norm_build_config(), |
| 66 **_kwargs): |
| 66 assert HOST_PLATFORM and HOST_ARCH and HOST_BITS | 67 assert HOST_PLATFORM and HOST_ARCH and HOST_BITS |
| 67 TARGET_PLATFORM = TARGET_PLATFORM or HOST_PLATFORM | 68 TARGET_PLATFORM = TARGET_PLATFORM or HOST_PLATFORM |
| 68 TARGET_ARCH = HOST_ARCH if TARGET_ARCH is HostPlatformValue else TARGET_ARCH | 69 TARGET_ARCH = HOST_ARCH if TARGET_ARCH is HostPlatformValue else TARGET_ARCH |
| 69 TARGET_BITS = HOST_BITS if TARGET_BITS is HostPlatformValue else TARGET_BITS | 70 TARGET_BITS = HOST_BITS if TARGET_BITS is HostPlatformValue else TARGET_BITS |
| 70 | 71 |
| 71 return ConfigGroup( | 72 return ConfigGroup( |
| 72 compile_py = ConfigGroup( | 73 compile_py = ConfigGroup( |
| 73 default_targets = SetConfig(str), | 74 default_targets = SetConfig(str), |
| 74 build_tool = SimpleConfig(str), | 75 build_tool = SimpleConfig(str), |
| 75 compiler = SimpleConfig(str, required=False), | 76 compiler = SimpleConfig(str, required=False), |
| 76 ), | 77 ), |
| 77 gyp_env = ConfigGroup( | 78 gyp_env = ConfigGroup( |
| 78 GYP_DEFINES = DictConfig(lambda i: ('%s=%s' % i), ' '.join, (str,int)), | 79 GYP_DEFINES = DictConfig(lambda i: ('%s=%s' % i), ' '.join, (str,int)), |
| 79 GYP_GENERATORS = SetConfig(str, ','.join), | 80 GYP_GENERATORS = SetConfig(str, ','.join), |
| 80 GYP_GENERATOR_FLAGS = DictConfig( | 81 GYP_GENERATOR_FLAGS = DictConfig( |
| 81 lambda i: ('%s=%s' % i), ' '.join, (str,int)), | 82 lambda i: ('%s=%s' % i), ' '.join, (str,int)), |
| 82 GYP_MSVS_VERSION = SimpleConfig(str, empty_val="", required=False), | 83 GYP_MSVS_VERSION = SimpleConfig(str, required=False), |
| 83 ), | 84 ), |
| 84 build_dir = SimpleConfig(str), | 85 build_dir = SimpleConfig(str), |
| 85 | 86 |
| 86 BUILD_CONFIG = StaticConfig(norm_build_config(BUILD_CONFIG)), | 87 BUILD_CONFIG = StaticConfig(norm_build_config(BUILD_CONFIG)), |
| 87 | 88 |
| 88 HOST_PLATFORM = StaticConfig(norm_host_platform(HOST_PLATFORM)), | 89 HOST_PLATFORM = StaticConfig(norm_host_platform(HOST_PLATFORM)), |
| 89 HOST_ARCH = StaticConfig(norm_arch(HOST_ARCH)), | 90 HOST_ARCH = StaticConfig(norm_arch(HOST_ARCH)), |
| 90 HOST_BITS = StaticConfig(norm_bits(HOST_BITS)), | 91 HOST_BITS = StaticConfig(norm_bits(HOST_BITS)), |
| 91 | 92 |
| 92 TARGET_PLATFORM = StaticConfig(norm_targ_platform(TARGET_PLATFORM)), | 93 TARGET_PLATFORM = StaticConfig(norm_targ_platform(TARGET_PLATFORM)), |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 dcheck(c, optional=True) | 230 dcheck(c, optional=True) |
| 230 | 231 |
| 231 #### 'Full' configurations | 232 #### 'Full' configurations |
| 232 @config_ctx(includes=['ninja', 'default_compiler', 'goma']) | 233 @config_ctx(includes=['ninja', 'default_compiler', 'goma']) |
| 233 def chromium(c): | 234 def chromium(c): |
| 234 c.compile_py.default_targets = ['All', 'chromium_builder_tests'] | 235 c.compile_py.default_targets = ['All', 'chromium_builder_tests'] |
| 235 | 236 |
| 236 @config_ctx(includes=['chromium']) | 237 @config_ctx(includes=['chromium']) |
| 237 def blink(c): | 238 def blink(c): |
| 238 c.compile_py.default_targets = ['all_webkit', 'content_shell'] | 239 c.compile_py.default_targets = ['all_webkit', 'content_shell'] |
| OLD | NEW |