public abstract class BuildTargetSpec extends Object implements TargetNodeSpec
TargetNode
that corresponds to a single build targetTargetNodeSpec.TargetType
Constructor and Description |
---|
BuildTargetSpec() |
public abstract UnconfiguredBuildTargetWithOutputs getUnconfiguredBuildTargetViewWithOutputs()
public UnconfiguredBuildTarget getUnconfiguredBuildTarget()
public static BuildTargetSpec of(UnconfiguredBuildTarget unconfiguredBuildTarget, BuildFileSpec buildFileSpec)
BuildTargetSpec
with an empty output label.public abstract BuildFileSpec getBuildFileSpec()
getBuildFileSpec
in interface TargetNodeSpec
BuildFileSpec
representing the build files to parse to search for specific
build target.public static BuildTargetSpec from(UnconfiguredBuildTargetWithOutputs targetWithOutputs)
BuildTargetSpec
and automatically resolve BuildFileSpec
based on UnconfiguredBuildTarget
properties. The returned BuildTargetSpec
may carry a non-empty output label through UnconfiguredBuildTargetWithOutputs
.targetWithOutputs
- Build target to matchpublic static BuildTargetSpec from(UnconfiguredBuildTarget target)
BuildTargetSpec
and automatically resolve BuildFileSpec
based on UnconfiguredBuildTarget
properties. The returned BuildTargetSpec
carries an empty output label.target
- Build target to matchpublic TargetNodeSpec.TargetType getTargetType()
getTargetType
in interface TargetNodeSpec
public com.google.common.collect.ImmutableMap<BuildTarget,TargetNodeMaybeIncompatible> filter(Iterable<TargetNodeMaybeIncompatible> nodes)
filter
in interface TargetNodeSpec
public BuildTargetPattern getBuildTargetPattern(Cell cell)
TargetNodeSpec
TargetNodeSpec
to a new-hotness BuildTargetPattern
.
This conversion is imperfect and best-effort. If possible, use BuildTargetPatternParser.parse(String, CellNameResolver)
to create a BuildTargetPattern
instead.
This conversion is lossy. Some attributes, such as whether test targets should be included, are not reflected in the result.
getBuildTargetPattern
in interface TargetNodeSpec
cell
- this TargetNodeSpec
's cell. Some implementations of TargetNodeSpec
do not store a cell name, so cell
provides the name.