2
0
Fork 0
mirror of https://github.com/bazel-contrib/bazel-lib synced 2024-12-01 07:15:24 +00:00
bazel-lib/docs/utils.md
Alex Eagle cb8c2bad22
feat: add some paths and utils (#1)
* feat: add some paths and utils

* test: exercise relative to_label

* chore: cleanup naming and rctx helper
2021-11-09 15:13:30 -08:00

2.3 KiB

Public API

glob_directories

glob_directories(include, kwargs)

PARAMETERS

Name Description Default Value
include

-

none
kwargs

-

none

is_external_label

is_external_label(param)

Returns True if the given Label (or stringy version of a label) represents a target outside of the workspace

PARAMETERS

Name Description Default Value
param a string or label none

RETURNS

a bool

path_to_workspace_root

path_to_workspace_root()

Retuns the path to the workspace root under bazel

RETURNS

Path to the workspace root

propagate_well_known_tags

propagate_well_known_tags(tags)

Returns a list of tags filtered from the input set that only contains the ones that are considered "well known"

These are listed in Bazel's documentation: https://docs.bazel.build/versions/main/test-encyclopedia.html#tag-conventions https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes

PARAMETERS

Name Description Default Value
tags List of tags to filter []

RETURNS

List of tags that only contains the well known set

to_label

to_label(param)

Converts a string to a Label. If Label is supplied, the same label is returned.

PARAMETERS

Name Description Default Value
param a string representing a label or a Label none

RETURNS

a Label