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), | |
29 | 28 |
30 revision = Single( | 29 revision = Single( |
31 (basestring, gclient_api.RevisionResolver), | 30 (basestring, gclient_api.RevisionResolver), |
32 required=False, hidden=True), | 31 required=False, hidden=True), |
33 ) | 32 ) |
34 ), | 33 ), |
35 deps_os = Dict(value_type=basestring), | 34 deps_os = Dict(value_type=basestring), |
36 hooks = List(basestring), | 35 hooks = List(basestring), |
37 target_os = Set(basestring), | 36 target_os = Set(basestring), |
38 target_os_only = Single(bool, empty_val=False, required=False), | 37 target_os_only = Single(bool, empty_val=False, required=False), |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 def chromium_empty(c): | 178 def chromium_empty(c): |
180 c.solutions[0].deps_file = '' # pragma: no cover | 179 c.solutions[0].deps_file = '' # pragma: no cover |
181 | 180 |
182 @config_ctx(includes=['chromium_bare']) | 181 @config_ctx(includes=['chromium_bare']) |
183 def chromium(c): | 182 def chromium(c): |
184 s = c.solutions[0] | 183 s = c.solutions[0] |
185 s.custom_deps = mirror_only(c, {}) | 184 s.custom_deps = mirror_only(c, {}) |
186 | 185 |
187 @config_ctx(includes=['chromium']) | 186 @config_ctx(includes=['chromium']) |
188 def chromium_lkcr(c): | 187 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 | |
193 s = c.solutions[0] | 188 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. | |
197 s.revision = 'origin/lkcr' | 189 s.revision = 'origin/lkcr' |
198 | 190 |
199 @config_ctx(includes=['chromium']) | 191 @config_ctx(includes=['chromium']) |
200 def chromium_lkgr(c): | 192 def chromium_lkgr(c): |
201 s = c.solutions[0] | 193 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 | |
207 s.revision = 'origin/lkgr' | 194 s.revision = 'origin/lkgr' |
208 | 195 |
209 @config_ctx(includes=['chromium_bare']) | 196 @config_ctx(includes=['chromium_bare']) |
210 def android_bare(c): | 197 def android_bare(c): |
211 # We inherit from chromium_bare to get the got_revision mapping. | 198 # We inherit from chromium_bare to get the got_revision mapping. |
212 # NOTE: We don't set a specific got_revision mapping for src/repo. | 199 # NOTE: We don't set a specific got_revision mapping for src/repo. |
213 del c.solutions[0] | 200 del c.solutions[0] |
214 c.got_revision_mapping['src'] = 'got_src_revision' | 201 c.got_revision_mapping['src'] = 'got_src_revision' |
215 s = c.solutions.add() | 202 s = c.solutions.add() |
216 s.deps_file = '.DEPS.git' | 203 s.deps_file = '.DEPS.git' |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 soln = c.solutions.add() | 670 soln = c.solutions.add() |
684 soln.name = 'gerrit-test-cq-normal' | 671 soln.name = 'gerrit-test-cq-normal' |
685 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' | 672 soln.url = 'https://chromium.googlesource.com/playground/gerrit-cq/normal.git' |
686 | 673 |
687 # TODO(phajdan.jr): Move to proper repo and add coverage. | 674 # TODO(phajdan.jr): Move to proper repo and add coverage. |
688 @config_ctx() | 675 @config_ctx() |
689 def valgrind(c): # pragma: no cover | 676 def valgrind(c): # pragma: no cover |
690 """Add Valgrind binaries to the gclient solution.""" | 677 """Add Valgrind binaries to the gclient solution.""" |
691 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ | 678 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ |
692 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') | 679 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') |
OLD | NEW |