public abstract class TargetNodePredicateSpec extends Object implements TargetNodeSpec
TargetNode
objects in a repository that match the specification.TargetNodeSpec.TargetType
Constructor and Description |
---|
TargetNodePredicateSpec() |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableMap<BuildTarget,TargetNodeMaybeIncompatible> |
filter(Iterable<TargetNodeMaybeIncompatible> nodes) |
abstract BuildFileSpec |
getBuildFileSpec() |
BuildTargetPattern |
getBuildTargetPattern(Cell cell)
Convert from a legacy
TargetNodeSpec to a new-hotness BuildTargetPattern . |
TargetNodeSpec.TargetType |
getTargetType() |
static TargetNodePredicateSpec |
of(BuildFileSpec buildFileSpec) |
static TargetNodePredicateSpec |
of(BuildFileSpec buildFileSpec,
boolean onlyTests) |
abstract boolean |
onlyTests() |
String |
toString() |
public abstract BuildFileSpec getBuildFileSpec()
getBuildFileSpec
in interface TargetNodeSpec
BuildFileSpec
representing the build files to parse to search for specific
build target.public abstract boolean onlyTests()
public 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.public static TargetNodePredicateSpec of(BuildFileSpec buildFileSpec)
public static TargetNodePredicateSpec of(BuildFileSpec buildFileSpec, boolean onlyTests)