|
@@ -24,6 +24,13 @@ else:
|
|
basestring = str
|
|
basestring = str
|
|
|
|
|
|
|
|
|
|
|
|
+# git_dependencies migration states. Used within the DEPS file to indicate
|
|
|
|
+# the current migration state.
|
|
|
|
+DEPS = 'DEPS'
|
|
|
|
+SYNC = 'SYNC'
|
|
|
|
+SUBMODULES = 'SUBMODULES'
|
|
|
|
+
|
|
|
|
+
|
|
class ConstantString(object):
|
|
class ConstantString(object):
|
|
def __init__(self, value):
|
|
def __init__(self, value):
|
|
self.value = value
|
|
self.value = value
|
|
@@ -156,6 +163,11 @@ _GCLIENT_HOOKS_SCHEMA = [
|
|
|
|
|
|
_GCLIENT_SCHEMA = schema.Schema(
|
|
_GCLIENT_SCHEMA = schema.Schema(
|
|
_NodeDictSchema({
|
|
_NodeDictSchema({
|
|
|
|
+ # Current state of the git submodule migration.
|
|
|
|
+ # git_dependencies = [DEPS (default) | SUBMODULES | SYNC]
|
|
|
|
+ schema.Optional('git_dependencies'):
|
|
|
|
+ schema.Or(DEPS, SYNC, SUBMODULES),
|
|
|
|
+
|
|
# List of host names from which dependencies are allowed (allowlist).
|
|
# List of host names from which dependencies are allowed (allowlist).
|
|
# NOTE: when not present, all hosts are allowed.
|
|
# NOTE: when not present, all hosts are allowed.
|
|
# NOTE: scoped to current DEPS file, not recursive.
|
|
# NOTE: scoped to current DEPS file, not recursive.
|
|
@@ -169,21 +181,25 @@ _GCLIENT_SCHEMA = schema.Schema(
|
|
#
|
|
#
|
|
# Var(): allows variable substitution (either from 'vars' dict below,
|
|
# Var(): allows variable substitution (either from 'vars' dict below,
|
|
# or command-line override)
|
|
# or command-line override)
|
|
- schema.Optional('deps'): _GCLIENT_DEPS_SCHEMA,
|
|
|
|
|
|
+ schema.Optional('deps'):
|
|
|
|
+ _GCLIENT_DEPS_SCHEMA,
|
|
|
|
|
|
# Similar to 'deps' (see above) - also keyed by OS (e.g. 'linux').
|
|
# Similar to 'deps' (see above) - also keyed by OS (e.g. 'linux').
|
|
# Also see 'target_os'.
|
|
# Also see 'target_os'.
|
|
- schema.Optional('deps_os'): _NodeDictSchema({
|
|
|
|
|
|
+ schema.Optional('deps_os'):
|
|
|
|
+ _NodeDictSchema({
|
|
schema.Optional(basestring): _GCLIENT_DEPS_SCHEMA,
|
|
schema.Optional(basestring): _GCLIENT_DEPS_SCHEMA,
|
|
}),
|
|
}),
|
|
|
|
|
|
# Dependency to get gclient_gn_args* settings from. This allows these
|
|
# Dependency to get gclient_gn_args* settings from. This allows these
|
|
# values to be set in a recursedeps file, rather than requiring that
|
|
# values to be set in a recursedeps file, rather than requiring that
|
|
# they exist in the top-level solution.
|
|
# they exist in the top-level solution.
|
|
- schema.Optional('gclient_gn_args_from'): basestring,
|
|
|
|
|
|
+ schema.Optional('gclient_gn_args_from'):
|
|
|
|
+ basestring,
|
|
|
|
|
|
# Path to GN args file to write selected variables.
|
|
# Path to GN args file to write selected variables.
|
|
- schema.Optional('gclient_gn_args_file'): basestring,
|
|
|
|
|
|
+ schema.Optional('gclient_gn_args_file'):
|
|
|
|
+ basestring,
|
|
|
|
|
|
# Subset of variables to write to the GN args file (see above).
|
|
# Subset of variables to write to the GN args file (see above).
|
|
schema.Optional('gclient_gn_args'): [schema.Optional(basestring)],
|
|
schema.Optional('gclient_gn_args'): [schema.Optional(basestring)],
|
|
@@ -191,12 +207,12 @@ _GCLIENT_SCHEMA = schema.Schema(
|
|
# Hooks executed after gclient sync (unless suppressed), or explicitly
|
|
# Hooks executed after gclient sync (unless suppressed), or explicitly
|
|
# on gclient hooks. See _GCLIENT_HOOKS_SCHEMA for details.
|
|
# on gclient hooks. See _GCLIENT_HOOKS_SCHEMA for details.
|
|
# Also see 'pre_deps_hooks'.
|
|
# Also see 'pre_deps_hooks'.
|
|
- schema.Optional('hooks'): _GCLIENT_HOOKS_SCHEMA,
|
|
|
|
|
|
+ schema.Optional('hooks'):
|
|
|
|
+ _GCLIENT_HOOKS_SCHEMA,
|
|
|
|
|
|
# Similar to 'hooks', also keyed by OS.
|
|
# Similar to 'hooks', also keyed by OS.
|
|
- schema.Optional('hooks_os'): _NodeDictSchema({
|
|
|
|
- schema.Optional(basestring): _GCLIENT_HOOKS_SCHEMA
|
|
|
|
- }),
|
|
|
|
|
|
+ schema.Optional('hooks_os'):
|
|
|
|
+ _NodeDictSchema({schema.Optional(basestring): _GCLIENT_HOOKS_SCHEMA}),
|
|
|
|
|
|
# Rules which #includes are allowed in the directory.
|
|
# Rules which #includes are allowed in the directory.
|
|
# Also see 'skip_child_includes' and 'specific_include_rules'.
|
|
# Also see 'skip_child_includes' and 'specific_include_rules'.
|
|
@@ -208,21 +224,22 @@ _GCLIENT_SCHEMA = schema.Schema(
|
|
# will not inherit rules from //base/DEPS and //base/allocator/DEPS,
|
|
# will not inherit rules from //base/DEPS and //base/allocator/DEPS,
|
|
# forcing each //base/allocator/partition_allocator/{foo,bar,...} to
|
|
# forcing each //base/allocator/partition_allocator/{foo,bar,...} to
|
|
# declare all its dependencies.
|
|
# declare all its dependencies.
|
|
- schema.Optional('noparent'): bool,
|
|
|
|
|
|
+ schema.Optional('noparent'):
|
|
|
|
+ bool,
|
|
|
|
|
|
# Hooks executed before processing DEPS. See 'hooks' for more details.
|
|
# Hooks executed before processing DEPS. See 'hooks' for more details.
|
|
- schema.Optional('pre_deps_hooks'): _GCLIENT_HOOKS_SCHEMA,
|
|
|
|
|
|
+ schema.Optional('pre_deps_hooks'):
|
|
|
|
+ _GCLIENT_HOOKS_SCHEMA,
|
|
|
|
|
|
# Recursion limit for nested DEPS.
|
|
# Recursion limit for nested DEPS.
|
|
- schema.Optional('recursion'): int,
|
|
|
|
|
|
+ schema.Optional('recursion'):
|
|
|
|
+ int,
|
|
|
|
|
|
# Allowlists deps for which recursion should be enabled.
|
|
# Allowlists deps for which recursion should be enabled.
|
|
schema.Optional('recursedeps'): [
|
|
schema.Optional('recursedeps'): [
|
|
- schema.Optional(schema.Or(
|
|
|
|
- basestring,
|
|
|
|
- (basestring, basestring),
|
|
|
|
- [basestring, basestring]
|
|
|
|
- )),
|
|
|
|
|
|
+ schema.Optional(
|
|
|
|
+ schema.Or(basestring, (basestring, basestring),
|
|
|
|
+ [basestring, basestring])),
|
|
],
|
|
],
|
|
|
|
|
|
# Blocklists directories for checking 'include_rules'.
|
|
# Blocklists directories for checking 'include_rules'.
|
|
@@ -230,9 +247,8 @@ _GCLIENT_SCHEMA = schema.Schema(
|
|
|
|
|
|
# Mapping from paths to include rules specific for that path.
|
|
# Mapping from paths to include rules specific for that path.
|
|
# See 'include_rules' for more details.
|
|
# See 'include_rules' for more details.
|
|
- schema.Optional('specific_include_rules'): _NodeDictSchema({
|
|
|
|
- schema.Optional(basestring): [basestring]
|
|
|
|
- }),
|
|
|
|
|
|
+ schema.Optional('specific_include_rules'):
|
|
|
|
+ _NodeDictSchema({schema.Optional(basestring): [basestring]}),
|
|
|
|
|
|
# List of additional OS names to consider when selecting dependencies
|
|
# List of additional OS names to consider when selecting dependencies
|
|
# from deps_os.
|
|
# from deps_os.
|
|
@@ -241,17 +257,19 @@ _GCLIENT_SCHEMA = schema.Schema(
|
|
# For recursed-upon sub-dependencies, check out their own dependencies
|
|
# For recursed-upon sub-dependencies, check out their own dependencies
|
|
# relative to the parent's path, rather than relative to the .gclient
|
|
# relative to the parent's path, rather than relative to the .gclient
|
|
# file.
|
|
# file.
|
|
- schema.Optional('use_relative_paths'): bool,
|
|
|
|
|
|
+ schema.Optional('use_relative_paths'):
|
|
|
|
+ bool,
|
|
|
|
|
|
# For recursed-upon sub-dependencies, run their hooks relative to the
|
|
# For recursed-upon sub-dependencies, run their hooks relative to the
|
|
# parent's path instead of relative to the .gclient file.
|
|
# parent's path instead of relative to the .gclient file.
|
|
- schema.Optional('use_relative_hooks'): bool,
|
|
|
|
|
|
+ schema.Optional('use_relative_hooks'):
|
|
|
|
+ bool,
|
|
|
|
|
|
# Variables that can be referenced using Var() - see 'deps'.
|
|
# Variables that can be referenced using Var() - see 'deps'.
|
|
- schema.Optional('vars'): _NodeDictSchema({
|
|
|
|
- schema.Optional(basestring): schema.Or(ConstantString,
|
|
|
|
- basestring,
|
|
|
|
- bool),
|
|
|
|
|
|
+ schema.Optional('vars'):
|
|
|
|
+ _NodeDictSchema({
|
|
|
|
+ schema.Optional(basestring):
|
|
|
|
+ schema.Or(ConstantString, basestring, bool),
|
|
}),
|
|
}),
|
|
}))
|
|
}))
|
|
|
|
|