select_file_doc.md

January 24, 2025 ยท View on GitHub

select_file() build rule implementation.

Selects a single file from the outputs of a target by given relative path.

select_file

load("@bazel_skylib//rules:select_file.bzl", "select_file")

select_file(name, srcs, subpath)

Selects a single file from the outputs of a target by given relative path

ATTRIBUTES

NameDescriptionTypeMandatoryDefault
nameA unique name for this target.Namerequired
srcsThe target producing the file among other outputsLabelrequired
subpathRelative path to the fileStringrequired