Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Side by Side Diff: recipe_modules/gclient/config.py

Issue 2270083004: Default gclient's GIT_MODE to True (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: A slightly gentler hand with pragmas Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « recipe_modules/gclient/api.py ('k') | recipe_modules/gclient/example.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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=True, 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,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 GIT_MODE = Static(bool(GIT_MODE)), 89 GIT_MODE = Static(bool(GIT_MODE)),
90 USE_MIRROR = Static(bool(USE_MIRROR)), 90 USE_MIRROR = Static(bool(USE_MIRROR)),
91 # TODO(tandrii): remove PATCH_PROJECT field. 91 # TODO(tandrii): remove PATCH_PROJECT field.
92 # DON'T USE THIS. WILL BE REMOVED. 92 # DON'T USE THIS. WILL BE REMOVED.
93 PATCH_PROJECT = Static(str(PATCH_PROJECT), hidden=True), 93 PATCH_PROJECT = Static(str(PATCH_PROJECT), hidden=True),
94 BUILDSPEC_VERSION= Static(BUILDSPEC_VERSION, hidden=True), 94 BUILDSPEC_VERSION= Static(BUILDSPEC_VERSION, hidden=True),
95 ) 95 )
96 96
97 config_ctx = config_item_context(BaseConfig) 97 config_ctx = config_item_context(BaseConfig)
98 98
99 def ChromiumSvnSubURL(c, *pieces): 99 def ChromiumSvnSubURL(c, *pieces): # pragma: no cover
100 BASES = ('https://src.chromium.org', 100 BASES = ('https://src.chromium.org',
101 'svn://svn-mirror.golo.chromium.org') 101 'svn://svn-mirror.golo.chromium.org')
102 return '/'.join((BASES[c.USE_MIRROR],) + pieces) 102 return '/'.join((BASES[c.USE_MIRROR],) + pieces)
103 103
104 def ChromiumGitURL(_c, *pieces): 104 def ChromiumGitURL(_c, *pieces):
105 return '/'.join(('https://chromium.googlesource.com',) + pieces) 105 return '/'.join(('https://chromium.googlesource.com',) + pieces)
106 106
107 def ChromiumSrcURL(c): 107 def ChromiumSrcURL(c):
108 # TODO(phajdan.jr): Move to proper repo and add coverage. 108 # TODO(phajdan.jr): Move to proper repo and add coverage.
109 if c.GIT_MODE: # pragma: no cover 109 if c.GIT_MODE:
110 return ChromiumGitURL(c, 'chromium', 'src.git') 110 return ChromiumGitURL(c, 'chromium', 'src.git')
111 else: 111 else: # pragma: no cover
112 return ChromiumSvnSubURL(c, 'chrome', 'trunk', 'src') 112 return ChromiumSvnSubURL(c, 'chrome', 'trunk', 'src')
113 113
114 def BlinkURL(c): 114 def BlinkURL(c):
115 # TODO(phajdan.jr): Move to proper repo and add coverage. 115 # TODO(phajdan.jr): Move to proper repo and add coverage.
116 if c.GIT_MODE: # pragma: no cover 116 if c.GIT_MODE:
117 return ChromiumGitURL(c, 'chromium', 'blink.git') 117 return ChromiumGitURL(c, 'chromium', 'blink.git')
118 else: 118 else: # pragma: no cover
119 return ChromiumSvnSubURL(c, 'blink', 'trunk') 119 return ChromiumSvnSubURL(c, 'blink', 'trunk')
120 120
121 def ChromeSvnSubURL(c, *pieces): 121 def ChromeSvnSubURL(c, *pieces): # pragma: no cover
122 BASES = ('svn://svn.chromium.org', 122 BASES = ('svn://svn.chromium.org',
123 'svn://svn-mirror.golo.chromium.org') 123 'svn://svn-mirror.golo.chromium.org')
124 return '/'.join((BASES[c.USE_MIRROR],) + pieces) 124 return '/'.join((BASES[c.USE_MIRROR],) + pieces)
125 125
126 # TODO(phajdan.jr): Move to proper repo and add coverage. 126 # TODO(phajdan.jr): Move to proper repo and add coverage.
127 def ChromeInternalGitURL(_c, *pieces): # pragma: no cover 127 def ChromeInternalGitURL(_c, *pieces): # pragma: no cover
128 return '/'.join(('https://chrome-internal.googlesource.com',) + pieces) 128 return '/'.join(('https://chrome-internal.googlesource.com',) + pieces)
129 129
130 def ChromeInternalSrcURL(c): 130 def ChromeInternalSrcURL(c):
131 # TODO(phajdan.jr): Move to proper repo and add coverage. 131 # TODO(phajdan.jr): Move to proper repo and add coverage.
132 if c.GIT_MODE: # pragma: no cover 132 if c.GIT_MODE:
133 return ChromeInternalGitURL(c, 'chrome', 'src-internal.git') 133 return ChromeInternalGitURL(c, 'chrome', 'src-internal.git')
134 else: 134 else: # pragma: no cover
135 return ChromeSvnSubURL(c, 'chrome-internal', 'trunk', 'src-internal') 135 return ChromeSvnSubURL(c, 'chrome-internal', 'trunk', 'src-internal')
136 136
137 def mirror_only(c, obj, default=None): 137 def mirror_only(c, obj, default=None):
138 return obj if c.USE_MIRROR else (default or obj.__class__()) 138 return obj if c.USE_MIRROR else (default or obj.__class__())
139 139
140 @config_ctx() 140 @config_ctx()
141 def chromium_bare(c): 141 def chromium_bare(c):
142 s = c.solutions.add() 142 s = c.solutions.add()
143 s.name = 'src' 143 s.name = 'src'
144 s.url = ChromiumSrcURL(c) 144 s.url = ChromiumSrcURL(c)
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 @config_ctx() 344 @config_ctx()
345 def gyp(c): 345 def gyp(c):
346 s = c.solutions.add() 346 s = c.solutions.add()
347 s.name = 'gyp' 347 s.name = 'gyp'
348 s.url = ChromiumGitURL(c, 'external', 'gyp.git') 348 s.url = ChromiumGitURL(c, 'external', 'gyp.git')
349 m = c.got_revision_mapping 349 m = c.got_revision_mapping
350 m['gyp'] = 'got_revision' 350 m['gyp'] = 'got_revision'
351 351
352 @config_ctx(config_vars={'GIT_MODE': True}) 352 @config_ctx(config_vars={'GIT_MODE': True})
353 def build(c): # pragma: no cover 353 def build(c):
354 if not c.GIT_MODE: 354 if not c.GIT_MODE: # pragma: no cover
355 raise BadConf('build only supports git') 355 raise BadConf('build only supports git')
356 s = c.solutions.add() 356 s = c.solutions.add()
357 s.name = 'build' 357 s.name = 'build'
358 s.url = ChromiumGitURL(c, 'chromium', 'tools', 'build.git') 358 s.url = ChromiumGitURL(c, 'chromium', 'tools', 'build.git')
359 m = c.got_revision_mapping 359 m = c.got_revision_mapping
360 m['build'] = 'got_revision' 360 m['build'] = 'got_revision'
361 361
362 @config_ctx(config_vars={'GIT_MODE': True}) 362 @config_ctx(config_vars={'GIT_MODE': True})
363 def depot_tools(c): # pragma: no cover 363 def depot_tools(c): # pragma: no cover
364 if not c.GIT_MODE: 364 if not c.GIT_MODE:
365 raise BadConf('depot_tools only supports git') 365 raise BadConf('depot_tools only supports git')
366 s = c.solutions.add() 366 s = c.solutions.add()
367 s.name = 'depot_tools' 367 s.name = 'depot_tools'
368 s.url = ChromiumGitURL(c, 'chromium', 'tools', 'depot_tools.git') 368 s.url = ChromiumGitURL(c, 'chromium', 'tools', 'depot_tools.git')
369 m = c.got_revision_mapping 369 m = c.got_revision_mapping
370 m['depot_tools'] = 'got_revision' 370 m['depot_tools'] = 'got_revision'
371 371
372 @config_ctx(config_vars={'GIT_MODE': True}) 372 @config_ctx(config_vars={'GIT_MODE': True})
373 def skia(c): # pragma: no cover 373 def skia(c): # pragma: no cover
374 if not c.GIT_MODE: 374 if not c.GIT_MODE:
375 raise BadConf('skia only supports git') 375 raise BadConf('skia only supports git')
376 s = c.solutions.add() 376 s = c.solutions.add()
377 s.name = 'skia' 377 s.name = 'skia'
378 s.url = 'https://skia.googlesource.com/skia.git' 378 s.url = 'https://skia.googlesource.com/skia.git'
379 m = c.got_revision_mapping 379 m = c.got_revision_mapping
380 m['skia'] = 'got_revision' 380 m['skia'] = 'got_revision'
381 381
382 @config_ctx(config_vars={'GIT_MODE': True}) 382 @config_ctx(config_vars={'GIT_MODE': True})
383 def chrome_golo(c): # pragma: no cover 383 def chrome_golo(c): # pragma: no cover
384 if not c.GIT_MODE: 384 if not c.GIT_MODE:
385 raise BadConf('chrome_golo only supports git') 385 raise BadConf('chrome_golo only supports git')
386 s = c.solutions.add() 386 s = c.solutions.add()
387 s.name = 'chrome_golo' 387 s.name = 'chrome_golo'
388 s.url = 'https://chrome-internal.googlesource.com/chrome-golo/chrome-golo.git' 388 s.url = 'https://chrome-internal.googlesource.com/chrome-golo/chrome-golo.git'
389 c.got_revision_mapping['chrome_golo'] = 'got_revision' 389 c.got_revision_mapping['chrome_golo'] = 'got_revision'
390 390
391 @config_ctx(config_vars={'GIT_MODE': True}) 391 @config_ctx(config_vars={'GIT_MODE': True})
392 def build_internal(c): 392 def build_internal(c):
393 if not c.GIT_MODE: # pragma: no cover 393 if not c.GIT_MODE: # pragma: no cover
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 """Add Valgrind binaries to the gclient solution.""" 671 """Add Valgrind binaries to the gclient solution."""
672 c.solutions[0].custom_deps['src/third_party/valgrind'] = \ 672 c.solutions[0].custom_deps['src/third_party/valgrind'] = \
673 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries') 673 ChromiumGitURL(c, 'chromium', 'deps', 'valgrind', 'binaries')
674 674
675 @config_ctx(includes=['chromium']) 675 @config_ctx(includes=['chromium'])
676 def chromedriver(c): 676 def chromedriver(c):
677 """Add Selenium Java tests to the gclient solution.""" 677 """Add Selenium Java tests to the gclient solution."""
678 c.solutions[0].custom_deps[ 678 c.solutions[0].custom_deps[
679 'src/chrome/test/chromedriver/third_party/java_tests'] = ( 679 'src/chrome/test/chromedriver/third_party/java_tests'] = (
680 ChromiumGitURL(c, 'chromium', 'deps', 'webdriver')) 680 ChromiumGitURL(c, 'chromium', 'deps', 'webdriver'))
OLDNEW
« no previous file with comments | « recipe_modules/gclient/api.py ('k') | recipe_modules/gclient/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698