mirror of https://github.com/bazelbuild/rules_cc
Rename ExpandArgs to NestedArgs
After discussion with @amontanez in unknown commit, we decided that NestedArgs was a more appropriate name. BEGIN_PUBLIC Rename ExpandArgs to NestedArgs END_PUBLIC PiperOrigin-RevId: 617085672 Change-Id: I1d7190cac79f8fa953d23be7d0db3b028a84cf30
This commit is contained in:
parent
bbb0615a87
commit
aa19278bbd
|
@ -25,8 +25,8 @@ load(
|
|||
"ActionTypeSetInfo",
|
||||
"ArgsInfo",
|
||||
"ArgsListInfo",
|
||||
"ExpandArgsInfo",
|
||||
"FeatureConstraintInfo",
|
||||
"NestedArgsInfo",
|
||||
)
|
||||
|
||||
visibility("public")
|
||||
|
@ -39,12 +39,12 @@ def _cc_args_impl(ctx):
|
|||
files = collect_files(ctx.attr.data)
|
||||
requires = collect_provider(ctx.attr.requires_any_of, FeatureConstraintInfo)
|
||||
|
||||
expand = None
|
||||
nested = None
|
||||
if ctx.attr.args:
|
||||
# TODO: This is temporary until cc_expand_args is implemented.
|
||||
expand = ExpandArgsInfo(
|
||||
# TODO: This is temporary until cc_nested_args is implemented.
|
||||
nested = NestedArgsInfo(
|
||||
label = ctx.label,
|
||||
expand = tuple(),
|
||||
nested = tuple(),
|
||||
iterate_over = None,
|
||||
files = files,
|
||||
requires_types = {},
|
||||
|
@ -55,7 +55,7 @@ def _cc_args_impl(ctx):
|
|||
label = ctx.label,
|
||||
actions = actions,
|
||||
requires_any_of = tuple(requires),
|
||||
expand = expand,
|
||||
nested = nested,
|
||||
env = ctx.attr.env,
|
||||
files = files,
|
||||
)
|
||||
|
|
|
@ -45,12 +45,12 @@ ActionTypeSetInfo = provider(
|
|||
},
|
||||
)
|
||||
|
||||
ExpandArgsInfo = provider(
|
||||
NestedArgsInfo = provider(
|
||||
doc = "A provider representation of Args.add/add_all/add_joined parameters",
|
||||
# @unsorted-dict-items
|
||||
fields = {
|
||||
"label": "(Label) The label defining this provider. Place in error messages to simplify debugging",
|
||||
"expand": "(Sequence[ExpandArgsInfo]) The nested arg expansion. Mutually exclusive with args",
|
||||
"nested": "(Sequence[NestedArgsInfo]) The nested arg expansion. Mutually exclusive with args",
|
||||
"iterate_over": "(Optional[str]) The variable to iterate over",
|
||||
"files": "(depset[File]) The files required to use this variable",
|
||||
"requires_types": "(dict[str, str]) A mapping from variables to their expected type name (not type). This means that we can require the generic type Option, rather than an Option[T]",
|
||||
|
@ -65,7 +65,7 @@ ArgsInfo = provider(
|
|||
"label": "(Label) The label defining this provider. Place in error messages to simplify debugging",
|
||||
"actions": "(depset[ActionTypeInfo]) The set of actions this is associated with",
|
||||
"requires_any_of": "(Sequence[FeatureConstraintInfo]) This will be enabled if any of the listed predicates are met. Equivalent to with_features",
|
||||
"expand": "(Optional[ExpandArgsInfo]) The args to expand. Equivalent to a flag group.",
|
||||
"nested": "(Optional[NestedArgsInfo]) The args to expand. Equivalent to a flag group.",
|
||||
"files": "(depset[File]) Files required for the args",
|
||||
"env": "(dict[str, str]) Environment variables to apply",
|
||||
},
|
||||
|
|
|
@ -64,11 +64,11 @@ def convert_args(args):
|
|||
]
|
||||
|
||||
flag_sets = []
|
||||
if args.expand != None:
|
||||
if args.nested != None:
|
||||
flag_sets.append(legacy_flag_set(
|
||||
actions = actions,
|
||||
with_features = with_features,
|
||||
flag_groups = [args.expand.legacy_flag_group],
|
||||
flag_groups = [args.nested.legacy_flag_group],
|
||||
))
|
||||
|
||||
env_sets = []
|
||||
|
|
|
@ -23,11 +23,11 @@ load(
|
|||
"ActionTypeSetInfo",
|
||||
"ArgsInfo",
|
||||
"ArgsListInfo",
|
||||
"ExpandArgsInfo",
|
||||
"FeatureConstraintInfo",
|
||||
"FeatureInfo",
|
||||
"FeatureSetInfo",
|
||||
"MutuallyExclusiveCategoryInfo",
|
||||
"NestedArgsInfo",
|
||||
"ToolInfo",
|
||||
"ToolchainConfigInfo",
|
||||
)
|
||||
|
@ -106,8 +106,8 @@ _FeatureConstraintFactory = generate_factory(
|
|||
),
|
||||
)
|
||||
|
||||
_EXPAND_ARGS_FLAGS = dict(
|
||||
expand = None,
|
||||
_NESTED_ARGS_FLAGS = dict(
|
||||
nested = None,
|
||||
files = _subjects.depset_file,
|
||||
iterate_over = optional_subject(_subjects.str),
|
||||
legacy_flag_group = unknown_subject,
|
||||
|
@ -115,18 +115,18 @@ _EXPAND_ARGS_FLAGS = dict(
|
|||
)
|
||||
|
||||
# buildifier: disable=name-conventions
|
||||
_FakeExpandArgsFactory = generate_factory(
|
||||
ExpandArgsInfo,
|
||||
"ExpandArgsInfo",
|
||||
_EXPAND_ARGS_FLAGS,
|
||||
_FakeNestedArgsFactory = generate_factory(
|
||||
NestedArgsInfo,
|
||||
"NestedArgsInfo",
|
||||
_NESTED_ARGS_FLAGS,
|
||||
)
|
||||
|
||||
# buildifier: disable=name-conventions
|
||||
_ExpandArgsFactory = generate_factory(
|
||||
ExpandArgsInfo,
|
||||
"ExpandArgsInfo",
|
||||
_EXPAND_ARGS_FLAGS | dict(
|
||||
expand = ProviderSequence(_FakeExpandArgsFactory),
|
||||
_NestedArgsFactory = generate_factory(
|
||||
NestedArgsInfo,
|
||||
"NestedArgsInfo",
|
||||
_NESTED_ARGS_FLAGS | dict(
|
||||
nested = ProviderSequence(_FakeNestedArgsFactory),
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -139,7 +139,7 @@ _ArgsFactory = generate_factory(
|
|||
env = _subjects.dict,
|
||||
files = _subjects.depset_file,
|
||||
# Use .factory so it's not inlined.
|
||||
expand = optional_subject(_ExpandArgsFactory.factory),
|
||||
nested = optional_subject(_NestedArgsFactory.factory),
|
||||
requires_any_of = ProviderSequence(_FeatureConstraintFactory),
|
||||
),
|
||||
)
|
||||
|
@ -220,7 +220,7 @@ _ToolchainConfigFactory = generate_factory(
|
|||
FACTORIES = [
|
||||
_ActionTypeFactory,
|
||||
_ActionTypeSetFactory,
|
||||
_ExpandArgsFactory,
|
||||
_NestedArgsFactory,
|
||||
_ArgsFactory,
|
||||
_ArgsListFactory,
|
||||
_MutuallyExclusiveCategoryFactory,
|
||||
|
|
Loading…
Reference in New Issue