| 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 import types | 5 import types |
| 6 | 6 |
| 7 from recipe_engine.config import config_item_context, ConfigGroup, BadConf | 7 from recipe_engine.config import config_item_context, ConfigGroup, BadConf |
| 8 from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List | 8 from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List |
| 9 | 9 |
| 10 from . import api as gclient_api | 10 from . import api as gclient_api |
| 11 | 11 |
| 12 | 12 |
| 13 def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None, | 13 def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None, |
| 14 PATCH_PROJECT=None, BUILDSPEC_VERSION=None, | 14 PATCH_PROJECT=None, BUILDSPEC_VERSION=None, |
| 15 **_kwargs): | 15 **_kwargs): |
| 16 deps = '.DEPS.git' if GIT_MODE else 'DEPS' | 16 deps = '.DEPS.git' if GIT_MODE else 'DEPS' |
| 17 cache_dir = str(CACHE_DIR) if GIT_MODE and CACHE_DIR else None | 17 cache_dir = str(CACHE_DIR) if GIT_MODE and CACHE_DIR else '' |
| 18 return ConfigGroup( | 18 return ConfigGroup( |
| 19 solutions = ConfigList( | 19 solutions = ConfigList( |
| 20 lambda: ConfigGroup( | 20 lambda: ConfigGroup( |
| 21 name = Single(basestring), | 21 name = Single(basestring), |
| 22 url = Single(basestring), | 22 url = Single(basestring), |
| 23 deps_file = Single(basestring, empty_val=deps, required=False, | 23 deps_file = Single(basestring, empty_val=deps, required=False, |
| 24 hidden=False), | 24 hidden=False), |
| 25 managed = Single(bool, empty_val=True, required=False, hidden=False), | 25 managed = Single(bool, empty_val=True, required=False, hidden=False), |
| 26 custom_deps = Dict(value_type=(basestring, types.NoneType)), | 26 custom_deps = Dict(value_type=(basestring, types.NoneType)), |
| 27 custom_vars = Dict(value_type=basestring), | 27 custom_vars = Dict(value_type=basestring), |
| 28 safesync_url = Single(basestring, required=False), | 28 safesync_url = Single(basestring, required=False), |
| 29 | 29 |
| 30 revision = Single( | 30 revision = Single( |
| 31 (basestring, gclient_api.RevisionResolver), | 31 (basestring, gclient_api.RevisionResolver), |
| 32 required=False, hidden=True), | 32 required=False, hidden=True), |
| 33 ) | 33 ) |
| 34 ), | 34 ), |
| 35 deps_os = Dict(value_type=basestring), | 35 deps_os = Dict(value_type=basestring), |
| 36 hooks = List(basestring), | 36 hooks = List(basestring), |
| 37 target_os = Set(basestring), | 37 target_os = Set(basestring), |
| 38 target_os_only = Single(bool, empty_val=False, required=False), | 38 target_os_only = Single(bool, empty_val=False, required=False), |
| 39 cache_dir = Static(cache_dir, hidden=False), | 39 cache_dir = Single( |
| 40 basestring, empty_val=cache_dir, required=False, hidden=False), |
| 40 | 41 |
| 41 # If supplied, use this as the source root (instead of the first solution's | 42 # If supplied, use this as the source root (instead of the first solution's |
| 42 # checkout). | 43 # checkout). |
| 43 src_root = Single(basestring, required=False, hidden=True), | 44 src_root = Single(basestring, required=False, hidden=True), |
| 44 | 45 |
| 45 # Maps 'solution' -> build_property | 46 # Maps 'solution' -> build_property |
| 46 got_revision_mapping = Dict(hidden=True), | 47 got_revision_mapping = Dict(hidden=True), |
| 47 | 48 |
| 48 # Addition revisions we want to pass in. For now theres a duplication | 49 # Addition revisions we want to pass in. For now theres a duplication |
| 49 # of code here of setting custom vars AND passing in --revision. We hope | 50 # of code here of setting custom vars AND passing in --revision. We hope |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 @config_ctx(includes=['chromium_bare']) | 163 @config_ctx(includes=['chromium_bare']) |
| 163 def chromium_empty(c): | 164 def chromium_empty(c): |
| 164 c.solutions[0].deps_file = '' # pragma: no cover | 165 c.solutions[0].deps_file = '' # pragma: no cover |
| 165 | 166 |
| 166 @config_ctx(includes=['chromium_bare']) | 167 @config_ctx(includes=['chromium_bare']) |
| 167 def chromium(c): | 168 def chromium(c): |
| 168 s = c.solutions[0] | 169 s = c.solutions[0] |
| 169 s.custom_deps = mirror_only(c, {}) | 170 s.custom_deps = mirror_only(c, {}) |
| 170 | 171 |
| 171 @config_ctx(includes=['chromium']) | 172 @config_ctx(includes=['chromium']) |
| 173 def chromium_no_git_cache(c): |
| 174 c.cache_dir = '' |
| 175 |
| 176 @config_ctx(includes=['chromium']) |
| 172 def chromium_lkcr(c): | 177 def chromium_lkcr(c): |
| 173 # TODO(phajdan.jr): Add git hashes for LKCR crbug.com/349277. | 178 # TODO(phajdan.jr): Add git hashes for LKCR crbug.com/349277. |
| 174 if c.GIT_MODE: | 179 if c.GIT_MODE: |
| 175 raise BadConf('Git has problems with safesync_url and LKCR, ' | 180 raise BadConf('Git has problems with safesync_url and LKCR, ' |
| 176 'crbug.com/349277 crbug.com/109191') # pragma: no cover | 181 'crbug.com/349277 crbug.com/109191') # pragma: no cover |
| 177 s = c.solutions[0] | 182 s = c.solutions[0] |
| 178 s.safesync_url = 'https://build.chromium.org/p/chromium/lkcr-status/lkgr' | 183 s.safesync_url = 'https://build.chromium.org/p/chromium/lkcr-status/lkgr' |
| 179 # TODO(hinoka): Once lkcr exists and is a tag, it should just be lkcr | 184 # TODO(hinoka): Once lkcr exists and is a tag, it should just be lkcr |
| 180 # rather than origin/lkcr. | 185 # rather than origin/lkcr. |
| 181 s.revision = 'origin/lkcr' | 186 s.revision = 'origin/lkcr' |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 soln = c.solutions.add() | 647 soln = c.solutions.add() |
| 643 soln.name = 'gerrit-test-cq-normal' | 648 soln.name = 'gerrit-test-cq-normal' |
| 644 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 649 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' |
| 645 | 650 |
| 646 # TODO(phajdan.jr): Move to proper repo and add coverage. | 651 # TODO(phajdan.jr): Move to proper repo and add coverage. |
| 647 @config_ctx() | 652 @config_ctx() |
| 648 def valgrind(c): # pragma: no cover | 653 def valgrind(c): # pragma: no cover |
| 649 """Add Valgrind binaries to the gclient solution.""" | 654 """Add Valgrind binaries to the gclient solution.""" |
| 650 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 655 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ |
| 651 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 656 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') |
| OLD | NEW |