public class TargetGraph extends DirectedAcyclicGraph<TargetNode<?>>
TargetNode
s constructed by parsing the build files.Modifier and Type | Field and Description |
---|---|
static TargetGraph |
EMPTY |
Constructor and Description |
---|
TargetGraph(MutableDirectedGraph<TargetNode<?>> graph,
com.google.common.collect.ImmutableMap<BuildTarget,TargetNode<?>> index) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
TargetNode<?> |
get(BuildTarget target)
Get a target from graph.
|
TargetNode<?> |
get(BuildTarget target,
DependencyStack dependencyStack)
Get a target from graph
|
Iterable<TargetNode<?>> |
getAll(Iterable<BuildTarget> targets) |
Optional<TargetNode<?>> |
getExactOptional(BuildTarget target)
Returns the target node for the exact given target, if it exists in the graph.
|
protected TargetNode<?> |
getInternal(BuildTarget target) |
Optional<TargetNode<?>> |
getOptional(BuildTarget target) |
int |
getSize() |
<T> TargetGraph |
getSubgraph(Iterable<? extends TargetNode<? extends T>> roots)
Get the subgraph of the the current graph containing the passed in roots and all of their
transitive dependencies as nodes.
|
int |
hashCode() |
getIncomingNodesFor, getNodes, getNodesWithNoIncomingEdges, getNodesWithNoOutgoingEdges, getOutgoingEdges, getOutgoingNodesFor
public static final TargetGraph EMPTY
public TargetGraph(MutableDirectedGraph<TargetNode<?>> graph, com.google.common.collect.ImmutableMap<BuildTarget,TargetNode<?>> index)
@Nullable protected TargetNode<?> getInternal(BuildTarget target)
public Optional<TargetNode<?>> getOptional(BuildTarget target)
public TargetNode<?> get(BuildTarget target)
get(BuildTarget, DependencyStack)
is encouraged
because it provides better diagnosticspublic TargetNode<?> get(BuildTarget target, DependencyStack dependencyStack)
public Optional<TargetNode<?>> getExactOptional(BuildTarget target)
If given a flavored target, and the target graph doesn't contain that flavored target, this
method will always return null, unlike getOptional
, which may return the node for a
differently flavored target (VersionedTargetGraph#getInternal
).
public Iterable<TargetNode<?>> getAll(Iterable<BuildTarget> targets)
public boolean equals(Object obj)
equals
in class DirectedAcyclicGraph<TargetNode<?>>
public int hashCode()
hashCode
in class DirectedAcyclicGraph<TargetNode<?>>
public <T> TargetGraph getSubgraph(Iterable<? extends TargetNode<? extends T>> roots)
roots
- An iterable containing the roots of the new subgraph.public int getSize()