ada_nested_args
Rules
ada_nested_args
load("@rules_ada//ada/toolchains:nested_args.bzl", "ada_nested_args")
ada_nested_args(name, data, args, iterate_over, nested, requires_false, requires_none,
requires_not_none, requires_true)
A node inside an ada_args template tree.
Nested args exist for conditions that must be evaluated per element of an
iterated list, such as wrapping only alwayslink libraries:
ada_args(
name = "libraries_to_link",
actions = LINK_ACTIONS,
iterate_over = "libraries_to_link",
nested = [":whole_archive_library", ":plain_library"],
)
ada_nested_args(
name = "whole_archive_library",
args = ["-Wl,-force_load,{libraries_to_link.file}"],
requires_true = "libraries_to_link.whole_archive",
)
ada_nested_args(
name = "plain_library",
args = ["{libraries_to_link.file}"],
requires_false = "libraries_to_link.whole_archive",
)
ATTRIBUTES
| Name | Description | Type | Mandatory | Default |
|---|---|---|---|---|
| name | A unique name for this target. | Name | required | |
| data | Files the arguments refer to; added as inputs of every action the arguments apply to. | List of labels | optional | [] |
| args | Argument templates. {name} and {name.field} expand variables of the action; an argument that is exactly {name} for a list variable expands to one argument per element. {{ and }} are literal braces. Mutually exclusive with nested. | List of strings | optional | [] |
| iterate_over | A list variable; the node is expanded once per element, with the element bound to the same name. | String | optional | "" |
| nested | ada_nested_args expanded in order after args, for per-element conditions. | List of labels | optional | [] |
| requires_false | Expand only if this bool variable is False. | String | optional | "" |
| requires_none | Expand only if this variable is unset or an empty list. | String | optional | "" |
| requires_not_none | Expand only if this variable is set and, for lists, non-empty. | String | optional | "" |
| requires_true | Expand only if this bool variable is True. | String | optional | "" |