| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 types | 5 import types |
| 6 | 6 |
| 7 from recipe_engine.config import config_item_context, ConfigGroup, Single | 7 from recipe_engine.config import ( |
| 8 config_item_context, ConfigGroup, Single, Static) |
| 8 from recipe_engine.config_types import Path | 9 from recipe_engine.config_types import Path |
| 9 from . import api as syzygy_api | 10 from . import api as syzygy_api |
| 10 | 11 |
| 11 | 12 |
| 12 def BaseConfig(**dummy_kwargs): | 13 def BaseConfig(CHECKOUT_PATH, **dummy_kwargs): |
| 13 return ConfigGroup( | 14 return ConfigGroup( |
| 15 CHECKOUT_PATH = Static(CHECKOUT_PATH), |
| 16 |
| 14 official_build = Single(bool, empty_val=False, required=False), | 17 official_build = Single(bool, empty_val=False, required=False), |
| 15 unittests_gypi = Single(Path, required=False), | 18 unittests_gypi = Single(Path, required=False), |
| 16 version_file = Single(Path, required=False), | 19 version_file = Single(Path, required=False), |
| 17 ) | 20 ) |
| 18 | 21 |
| 19 | 22 |
| 20 config_ctx = config_item_context(BaseConfig) | 23 config_ctx = config_item_context(BaseConfig) |
| 21 | 24 |
| 22 | 25 |
| 23 @config_ctx(is_root=True) | 26 @config_ctx(is_root=True) |
| 24 def BASE(c): | 27 def BASE(c): |
| 25 pass | 28 pass |
| 26 | 29 |
| 27 | 30 |
| 28 @config_ctx() | 31 @config_ctx() |
| 29 def syzygy(c): | 32 def syzygy(c): |
| 30 c.official_build = False | 33 c.official_build = False |
| 31 c.unittests_gypi = Path('[CHECKOUT]', 'syzygy', 'unittests.gypi') | 34 c.unittests_gypi = c.CHECKOUT_PATH.join('syzygy', 'unittests.gypi') |
| 32 c.version_file = Path('[CHECKOUT]', 'syzygy', 'SYZYGY_VERSION') | 35 c.version_file = c.CHECKOUT_PATH.join('syzygy', 'SYZYGY_VERSION') |
| 33 | 36 |
| 34 | 37 |
| 35 @config_ctx() | 38 @config_ctx() |
| 36 def syzygy_official(c): | 39 def syzygy_official(c): |
| 37 c.official_build = True | 40 c.official_build = True |
| 38 c.unittests_gypi = Path('[CHECKOUT]', 'syzygy', 'unittests.gypi') | 41 c.unittests_gypi = c.CHECKOUT_PATH.join('syzygy', 'unittests.gypi') |
| 39 c.version_file = Path('[CHECKOUT]', 'syzygy', 'SYZYGY_VERSION') | 42 c.version_file = c.CHECKOUT_PATH.join('syzygy', 'SYZYGY_VERSION') |
| 40 | 43 |
| 41 | 44 |
| 42 @config_ctx() | 45 @config_ctx() |
| 43 def kasko_official(c): | 46 def kasko_official(c): |
| 44 c.official_build = True | 47 c.official_build = True |
| 45 c.unittests_gypi = Path('[CHECKOUT]', 'syzygy', 'kasko', 'unittests.gypi') | 48 c.unittests_gypi = c.CHECKOUT_PATH.join('syzygy', 'kasko', 'unittests.gypi') |
| 46 c.version_file = Path('[CHECKOUT]', 'syzygy', 'kasko', 'VERSION') | 49 c.version_file = c.CHECKOUT_PATH.join('syzygy', 'kasko', 'VERSION') |
| OLD | NEW |