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

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
dataFiles the arguments refer to; added as inputs of every action the arguments apply to.List of labelsoptional[]
argsArgument 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 stringsoptional[]
iterate_overA list variable; the node is expanded once per element, with the element bound to the same name.Stringoptional""
nestedada_nested_args expanded in order after args, for per-element conditions.List of labelsoptional[]
requires_falseExpand only if this bool variable is False.Stringoptional""
requires_noneExpand only if this variable is unset or an empty list.Stringoptional""
requires_not_noneExpand only if this variable is set and, for lists, non-empty.Stringoptional""
requires_trueExpand only if this bool variable is True.Stringoptional""