A single input or output file for an action.
There is no
.parent method on
artifact, but in most cases
cmd_args(my_artifact).parent() can be used to similar effect.
def artifact.as_output() -> output_artifact
StarlarkOutputArtifact instance, or fails if the artifact is either an
Artifact, or is a bound
Artifact (You cannot bind twice)
The base name of this artifact. e.g. for an artifact at
foo/bar, this is
The file extension of this artifact. e.g. for an artifact at foo/bar.sh, this is
.sh. If no extension is present,
"" is returned.
Whether the artifact represents a source file
artifact.owner: None | label
Label of the rule that originally created this artifact. May also be None in the case of source files, or if the artifact has not be used in an action, or if the action was not created by a rule.
hide_prefix: bool = False
) -> artifact
Create an artifact that lives at path relative from this artifact.
For example, if artifact foo is a directory containing a file bar, then
yields the file bar. It is possible for projected artifacts to hide the prefix in order to
have the short name of the resulting artifact only contain the projected path, by passing
hide_prefix = True to
The interesting part of the path, relative to somewhere in the output directory. For an artifact declared as
foo/bar, this is
def artifact.with_associated_artifacts(artifacts: list[artifact]) -> artifact
StarlarkArtifact instance which is identical to the original artifact, but with potentially additional artifacts. The artifacts must be bound.
def artifact.without_associated_artifacts() -> artifact
StarlarkArtifact instance which is identical to the original artifact, except with no associated artifacts