| 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 CACHE_DIR else None | 17 cache_dir = str(CACHE_DIR) if CACHE_DIR else None |
| 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 | 29 |
| 29 revision = Single( | 30 revision = Single( |
| 30 (basestring, gclient_api.RevisionResolver), | 31 (basestring, gclient_api.RevisionResolver), |
| 31 required=False, hidden=True), | 32 required=False, hidden=True), |
| 32 ) | 33 ) |
| 33 ), | 34 ), |
| 34 deps_os = Dict(value_type=basestring), | 35 deps_os = Dict(value_type=basestring), |
| 35 hooks = List(basestring), | 36 hooks = List(basestring), |
| 36 target_os = Set(basestring), | 37 target_os = Set(basestring), |
| 37 target_os_only = Single(bool, empty_val=False, required=False), | 38 target_os_only = Single(bool, empty_val=False, required=False), |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 def chromium_empty(c): | 179 def chromium_empty(c): |
| 179 c.solutions[0].deps_file = '' # pragma: no cover | 180 c.solutions[0].deps_file = '' # pragma: no cover |
| 180 | 181 |
| 181 @config_ctx(includes=['chromium_bare']) | 182 @config_ctx(includes=['chromium_bare']) |
| 182 def chromium(c): | 183 def chromium(c): |
| 183 s = c.solutions[0] | 184 s = c.solutions[0] |
| 184 s.custom_deps = mirror_only(c, {}) | 185 s.custom_deps = mirror_only(c, {}) |
| 185 | 186 |
| 186 @config_ctx(includes=['chromium']) | 187 @config_ctx(includes=['chromium']) |
| 187 def chromium_lkcr(c): | 188 def chromium_lkcr(c): |
| 189 # TODO(phajdan.jr): Add git hashes for LKCR crbug.com/349277. |
| 190 if c.GIT_MODE: |
| 191 raise BadConf('Git has problems with safesync_url and LKCR, ' |
| 192 'crbug.com/349277 crbug.com/109191') # pragma: no cover |
| 188 s = c.solutions[0] | 193 s = c.solutions[0] |
| 194 s.safesync_url = 'https://build.chromium.org/p/chromium/lkcr-status/lkgr' |
| 195 # TODO(hinoka): Once lkcr exists and is a tag, it should just be lkcr |
| 196 # rather than origin/lkcr. |
| 189 s.revision = 'origin/lkcr' | 197 s.revision = 'origin/lkcr' |
| 190 | 198 |
| 191 @config_ctx(includes=['chromium']) | 199 @config_ctx(includes=['chromium']) |
| 192 def chromium_lkgr(c): | 200 def chromium_lkgr(c): |
| 193 s = c.solutions[0] | 201 s = c.solutions[0] |
| 202 safesync_url = 'https://chromium-status.appspot.com/lkgr' |
| 203 if c.GIT_MODE: # pragma: no cover |
| 204 safesync_url = 'https://chromium-status.appspot.com/git-lkgr' |
| 205 raise BadConf('Git has problems with safesync_url, crbug.com/109191.') |
| 206 s.safesync_url = safesync_url |
| 194 s.revision = 'origin/lkgr' | 207 s.revision = 'origin/lkgr' |
| 195 | 208 |
| 196 @config_ctx(includes=['chromium_bare']) | 209 @config_ctx(includes=['chromium_bare']) |
| 197 def android_bare(c): | 210 def android_bare(c): |
| 198 # We inherit from chromium_bare to get the got_revision mapping. | 211 # We inherit from chromium_bare to get the got_revision mapping. |
| 199 # NOTE: We don't set a specific got_revision mapping for src/repo. | 212 # NOTE: We don't set a specific got_revision mapping for src/repo. |
| 200 del c.solutions[0] | 213 del c.solutions[0] |
| 201 c.got_revision_mapping['src'] = 'got_src_revision' | 214 c.got_revision_mapping['src'] = 'got_src_revision' |
| 202 s = c.solutions.add() | 215 s = c.solutions.add() |
| 203 s.deps_file = '.DEPS.git' | 216 s.deps_file = '.DEPS.git' |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 soln = c.solutions.add() | 675 soln = c.solutions.add() |
| 663 soln.name = 'gerrit-test-cq-normal' | 676 soln.name = 'gerrit-test-cq-normal' |
| 664 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 677 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' |
| 665 | 678 |
| 666 # TODO(phajdan.jr): Move to proper repo and add coverage. | 679 # TODO(phajdan.jr): Move to proper repo and add coverage. |
| 667 @config_ctx() | 680 @config_ctx() |
| 668 def valgrind(c): # pragma: no cover | 681 def valgrind(c): # pragma: no cover |
| 669 """Add Valgrind binaries to the gclient solution.""" | 682 """Add Valgrind binaries to the gclient solution.""" |
| 670 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 683 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ |
| 671 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 684 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') |
| OLD | NEW |