public class TargetVariablesQueryEnvironment<NODE_TYPE> extends Object implements QueryEnvironment<NODE_TYPE>
QueryEnvironment augmented with additional target
variables.QueryEnvironment.Argument<ENV_NODE_TYPE>, QueryEnvironment.ArgumentType, QueryEnvironment.QueryFunction<OUTPUT_TYPE extends QueryTarget,ENV_NODE_TYPE>, QueryEnvironment.TargetEvaluator| Constructor and Description |
|---|
TargetVariablesQueryEnvironment(com.google.common.collect.ImmutableMap<String,Set<NODE_TYPE>> targetVariables,
QueryEnvironment<NODE_TYPE> delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
buildTransitiveClosure(Set<? extends QueryTarget> targetNodes,
int maxDepth)
Construct the dependency graph for a depth-bounded forward transitive closure of all nodes in
"targetNodes".
|
Set<Object> |
filterAttributeContents(NODE_TYPE target,
String attribute,
java.util.function.Predicate<Object> predicate)
Returns the objects in the `attribute` of the given `target` that satisfy `predicate`
|
Set<QueryFileTarget> |
getBuildFiles(Set<NODE_TYPE> targets)
Returns the build files that define the given targets.
|
Set<NODE_TYPE> |
getFileOwners(com.google.common.collect.ImmutableList<String> files)
Returns the targets that own one or more of the given files.
|
Iterable<QueryEnvironment.QueryFunction<?,NODE_TYPE>> |
getFunctions()
Returns the set of query functions implemented by this query environment.
|
Set<NODE_TYPE> |
getFwdDeps(Iterable<NODE_TYPE> targets)
Returns the direct forward dependencies of the specified targets.
|
Set<QueryFileTarget> |
getInputs(NODE_TYPE target) |
Set<NODE_TYPE> |
getReverseDeps(Iterable<NODE_TYPE> targets)
Returns the direct reverse dependencies of the specified targets.
|
QueryEnvironment.TargetEvaluator |
getTargetEvaluator()
Returns an evaluator for target patterns.
|
String |
getTargetKind(NODE_TYPE target) |
Set<? extends QueryTarget> |
getTargetsInAttribute(NODE_TYPE target,
String attribute)
Returns the existing targets in the value of `attribute` of the given `target`.
|
Set<NODE_TYPE> |
getTestsForTarget(NODE_TYPE target)
Returns the tests associated with the given target.
|
Set<NODE_TYPE> |
getTransitiveClosure(Set<NODE_TYPE> targets)
Returns the forward transitive closure of all of the targets in "targets".
|
Set<NODE_TYPE> |
resolveTargetVariable(String name) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachFwdDep, getTargetsMatchingPatternpublic TargetVariablesQueryEnvironment(com.google.common.collect.ImmutableMap<String,Set<NODE_TYPE>> targetVariables, QueryEnvironment<NODE_TYPE> delegate)
public QueryEnvironment.TargetEvaluator getTargetEvaluator()
QueryEnvironmentgetTargetEvaluator in interface QueryEnvironment<NODE_TYPE>public Set<NODE_TYPE> getFwdDeps(Iterable<NODE_TYPE> targets) throws QueryException
QueryEnvironmentgetFwdDeps in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<NODE_TYPE> getReverseDeps(Iterable<NODE_TYPE> targets) throws QueryException
QueryEnvironmentgetReverseDeps in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<QueryFileTarget> getInputs(NODE_TYPE target) throws QueryException
getInputs in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<NODE_TYPE> getTransitiveClosure(Set<NODE_TYPE> targets) throws QueryException
QueryEnvironmentQueryEnvironment.buildTransitiveClosure(java.util.Set<? extends com.facebook.buck.core.model.QueryTarget>, int) has been called for the relevant subgraph.getTransitiveClosure in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic void buildTransitiveClosure(Set<? extends QueryTarget> targetNodes, int maxDepth) throws QueryException
QueryEnvironmentIf a larger transitive closure was already built, returns it to improve incrementality, since all depth-constrained methods filter it after it is built anyway.
buildTransitiveClosure in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic String getTargetKind(NODE_TYPE target) throws QueryException
getTargetKind in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<NODE_TYPE> getTestsForTarget(NODE_TYPE target) throws QueryException
QueryEnvironmentgetTestsForTarget in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<QueryFileTarget> getBuildFiles(Set<NODE_TYPE> targets) throws QueryException
QueryEnvironmentgetBuildFiles in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<NODE_TYPE> getFileOwners(com.google.common.collect.ImmutableList<String> files) throws QueryException
QueryEnvironmentgetFileOwners in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<? extends QueryTarget> getTargetsInAttribute(NODE_TYPE target, String attribute) throws QueryException
QueryEnvironmentNote that unlike most methods in this interface, this method can return a heterogeneous
collection of objects that implement QueryTarget.
getTargetsInAttribute in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Set<Object> filterAttributeContents(NODE_TYPE target, String attribute, java.util.function.Predicate<Object> predicate) throws QueryException
QueryEnvironmentfilterAttributeContents in interface QueryEnvironment<NODE_TYPE>QueryExceptionpublic Iterable<QueryEnvironment.QueryFunction<?,NODE_TYPE>> getFunctions()
QueryEnvironmentgetFunctions in interface QueryEnvironment<NODE_TYPE>public Set<NODE_TYPE> resolveTargetVariable(String name)
resolveTargetVariable in interface QueryEnvironment<NODE_TYPE>QueryTargets expanded from the given variable name.