@ -8,95 +8,85 @@ from recipe_engine.config import ConfigList, Dict, Single, Static, Set, List
from . import api as gclient_api
from . import api as gclient_api
def BaseConfig ( USE_MIRROR = True , CACHE_DIR = None ,
def BaseConfig ( USE_MIRROR = True ,
BUILDSPEC_VERSION = None , deps_file = ' .DEPS.git ' , * * _kwargs ) :
CACHE_DIR = None ,
deps_file = ' .DEPS.git ' ,
* * _kwargs ) :
cache_dir = str ( CACHE_DIR ) if CACHE_DIR else None
cache_dir = str ( CACHE_DIR ) if CACHE_DIR else None
return ConfigGroup (
return ConfigGroup (
solutions = ConfigList (
solutions = ConfigList ( lambda : ConfigGroup (
lambda : ConfigGroup (
name = Single ( str ) ,
name = Single ( str ) ,
url = Single ( ( str , type ( None ) ) , empty_val = ' ' ) ,
url = Single ( ( str , type ( None ) ) , empty_val = ' ' ) ,
deps_file = Single (
deps_file = Single ( str , empty_val = deps_file , required = False ,
str , empty_val = deps_file , required = False , hidden = False ) ,
hidden = False ) ,
managed = Single ( bool , empty_val = True , required = False , hidden = False ) ,
managed = Single ( bool , empty_val = True , required = False , hidden = False ) ,
custom_deps = Dict ( value_type = ( str , type ( None ) ) ) ,
custom_deps = Dict ( value_type = ( str , type ( None ) ) ) ,
custom_vars = Dict ( value_type = ( str , bool ) ) ,
custom_vars = Dict ( value_type = ( str , bool ) ) ,
safesync_url = Single ( str , required = False ) ,
safesync_url = Single ( str , required = False ) ,
revision = Single (
( str , gclient_api . RevisionResolver ) , required = False , hidden = True ) ,
revision = Single (
) ) ,
( str , gclient_api . RevisionResolver ) ,
deps_os = Dict ( value_type = str ) ,
required = False , hidden = True ) ,
hooks = List ( str ) ,
)
target_os = Set ( str ) ,
) ,
target_os_only = Single ( bool , empty_val = False , required = False ) ,
deps_os = Dict ( value_type = str ) ,
target_cpu = Set ( str ) ,
hooks = List ( str ) ,
target_cpu_only = Single ( bool , empty_val = False , required = False ) ,
target_os = Set ( str ) ,
cache_dir = Static ( cache_dir , hidden = False ) ,
target_os_only = Single ( bool , empty_val = False , required = False ) ,
target_cpu = Set ( str ) ,
# Maps 'solution' -> build_property
target_cpu_only = Single ( bool , empty_val = False , required = False ) ,
# TODO(machenbach): Deprecate this in favor of the one below.
cache_dir = Static ( cache_dir , hidden = False ) ,
# http://crbug.com/713356
got_revision_mapping = Dict ( hidden = True ) ,
# Maps 'solution' -> build_property
# TODO(machenbach): Deprecate this in favor of the one below.
# Maps build_property -> 'solution'
# http://crbug.com/713356
got_revision_reverse_mapping = Dict ( hidden = True ) ,
got_revision_mapping = Dict ( hidden = True ) ,
# Addition revisions we want to pass in. For now there's a duplication
# Maps build_property -> 'solution'
# of code here of setting custom vars AND passing in --revision. We hope
got_revision_reverse_mapping = Dict ( hidden = True ) ,
# to remove custom vars later.
revisions = Dict ( value_type = ( str , gclient_api . RevisionResolver ) ,
# Addition revisions we want to pass in. For now there's a duplication
hidden = True ) ,
# of code here of setting custom vars AND passing in --revision. We hope
# to remove custom vars later.
# TODO(iannucci): HACK! The use of None here to indicate that we apply
revisions = Dict (
# this to the solution.revision field is really terrible. I mostly blame
value_type = ( str , gclient_api . RevisionResolver ) ,
# gclient.
hidden = True ) ,
# Maps 'parent_build_property' -> 'custom_var_name'
# Maps 'parent_build_property' -> None
# TODO(iannucci): HACK! The use of None here to indicate that we apply this
# If value is None, the property value will be applied to
# to the solution.revision field is really terrible. I mostly blame
# solutions[0].revision. Otherwise, it will be applied to
# gclient.
# solutions[0].custom_vars['custom_var_name']
# Maps 'parent_build_property' -> 'custom_var_name'
parent_got_revision_mapping = Dict ( hidden = True ) ,
# Maps 'parent_build_property' -> None
delete_unversioned_trees = Single ( bool , empty_val = True , required = False ) ,
# If value is None, the property value will be applied to
# solutions[0].revision. Otherwise, it will be applied to
# Maps canonical repo URL to (local_path, revision).
# solutions[0].custom_vars['custom_var_name']
# - canonical gitiles repo URL is "https://<host>/<project>"
parent_got_revision_mapping = Dict ( hidden = True ) ,
# where project does not have "/a/" prefix or ".git" suffix.
delete_unversioned_trees = Single ( bool , empty_val = True , required = False ) ,
# - solution/path is then used to apply patches as patch root in
# bot_update.
# Maps canonical repo URL to (local_path, revision).
# - if revision is given, it's passed verbatim to bot_update for
# - canonical gitiles repo URL is "https://<host>/<project>"
# corresponding dependency. Otherwise (i.e. None), the patch will be
# where project does not have "/a/" prefix or ".git" suffix.
# applied on top of version pinned in DEPS.
# - solution/path is then used to apply patches as patch root in
# This is essentially a allowlist of which repos inside a solution
# bot_update.
# can be patched automatically by bot_update based on
# - if revision is given, it's passed verbatim to bot_update for
# api.buildbucket.build.input.gerrit_changes[0].project
# corresponding dependency. Otherwise (i.e. None), the patch will be
# For example, if bare chromium solution has this entry in repo_path_map
# applied on top of version pinned in DEPS.
# 'https://chromium.googlesource.com/angle/angle': (
# This is essentially a allowlist of which repos inside a solution
# 'src/third_party/angle', 'HEAD')
# can be patched automatically by bot_update based on
# then a patch to Angle project can be applied to a chromium src's
# api.buildbucket.build.input.gerrit_changes[0].project
# checkout after first updating Angle's repo to its main's HEAD.
# For example, if bare chromium solution has this entry in repo_path_map
repo_path_map = Dict ( value_type = tuple , hidden = True ) ,
# 'https://chromium.googlesource.com/angle/angle': (
# 'src/third_party/angle', 'HEAD')
# Check out refs/branch-heads.
# then a patch to Angle project can be applied to a chromium src's
# TODO (machenbach): Only implemented for bot_update atm.
# checkout after first updating Angle's repo to its main's HEAD.
with_branch_heads = Single ( bool ,
repo_path_map = Dict ( value_type = tuple , hidden = True ) ,
empty_val = False ,
required = False ,
# Check out refs/branch-heads.
hidden = True ) ,
# TODO (machenbach): Only implemented for bot_update atm.
with_branch_heads = Single (
# Check out refs/tags.
bool ,
with_tags = Single ( bool , empty_val = False , required = False , hidden = True ) ,
empty_val = False ,
USE_MIRROR = Static ( bool ( USE_MIRROR ) ) ,
required = False ,
hidden = True ) ,
# Check out refs/tags.
with_tags = Single (
bool ,
empty_val = False ,
required = False ,
hidden = True ) ,
USE_MIRROR = Static ( bool ( USE_MIRROR ) ) ,
BUILDSPEC_VERSION = Static ( BUILDSPEC_VERSION , hidden = True ) ,
)
)
config_ctx = config_item_context ( BaseConfig )
config_ctx = config_item_context ( BaseConfig )