rules_runfiles_groupAPI docs @0.0.1-rc.2

@rules_runfiles_group//runfiles_group:lib.bzl

Public API for runfiles group library functions.

Functions & Macros

lib.group_names

Returns the list of group names in a RunfilesGroupInfo instance.

Parameters
*runfiles_group_info
lib.ordered_groups
Parameters
*runfiles_group_info
runfiles_group_selection_info
Default: None
lib.transform_groups
Parameters
*runfiles_group_info
runfiles_transform_info
Default: None

@rules_runfiles_group//runfiles_group:providers.bzl

Public API for runfiles group providers.

Providers

RunfilesGroupInfo

Information about grouped runfiles.

Each field in this provider is a depset of File objects, representing a category of runfiles.
Merging all depsets from all fields should yield the same set (or a superset) of files as DefaultInfo.default_runfiles.

This provider functions similarly to OutputGroupInfo, but its presence in the output of a rule indicates that it can be used instead of DefaultInfo.default_runfiles.
It categorizes the runfiles of a target into different groups, allowing for more fine-grained control over which runfiles are used in different contexts.

RunfilesGroupSelectionInfo

Information about filtering and ordering groups of runfiles.

Fields
predicate

A starlark function that takes a single string (group name).
The function should return True if the group should be included in the output (and return False otherwise).
Set in functional form, None in list form.

compare

A starlark function that takes two strings as input (group names)
and returns True if the first group name should come before the second (and False otherwise).
Set in functional form, None in list form.

group_names

A list of group names defining the desired order.
Set in list form, None in functional form.
Mutually exclusive with predicate and compare.

extra_group_treatment

How to treat groups not in group_names. One of "exclude", "prepend", or "append".
Set in list form, None in functional form.

RunfilesGroupTransformInfo

Information about how to transform a RunfilesGroupInfo by merging groups.

Fields
transform

A starlark function that takes a RunfilesGroupInfo and returns a new RunfilesGroupInfo.
Set in functional form, None in dict form.

merge_groups

A dict mapping output group name (string) to a list of source group names (list of string).
Each source group's depset is merged into the output group.
Set in dict form, None in functional form.

unmatched_group_treatment

How to treat groups not listed in any merge_groups value.
One of "exclude", "keep_separate", or "merge_default".
Defaults to "keep_separate" if omitted. Set in dict form, None in functional form.

default_group_name

The name of the group that unmatched groups are merged into.
Required when unmatched_group_treatment is "merge_default", None otherwise.

@rules_runfiles_group//runfiles_group:runfiles_group_analysis_test.bzl

Public API for runfiles_group_analysis_test.

Rules

runfiles_group_analysis_test

Checks that RunfilesGroupInfo is well formed by comparing the runfiles of the executable (DefaultInfo.default_runfiles.files)
with the union of all runfiles from RunfilesGroupInfo.

Additionally, it can warn about files appearing in multiple groups (overlapping).

AttributeTypeDescription
*namename

A unique name for this target.

*binarieslist of labels

List of *_binary targets to test.

overlapping_group_behaviorstring

How to handle overlapping groups (the same file being present in more than one group).

Default: "warn"