public interface TargetNode<T extends ConstructorArg> extends Comparable<TargetNode<?>>, ObeysVisibility, HasBuildTarget, ComputeResult, DependencyStack.ProvidesElement
TargetNode
represents a node in the target graph which is created by the Parser
as a result of parsing BUCK files in a project. It is
responsible for processing the raw (python) inputs of a build rule, and gathering any build
targets and paths referenced from those inputs.Modifier and Type | Method and Description |
---|---|
default <U extends ConstructorArg> |
cast(Class<U> newArgClass) |
default TargetNode<T> |
copyWithFlavors(FlavorSet flavors) |
TargetNode<T> |
copyWithFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
This method copies this target node with applying logic in
ImplicitDepsInferringDescription that may give
different results for deps based on flavors. |
Set<BuildTarget> |
getBuildDeps() |
BuildTarget |
getBuildTarget() |
com.google.common.collect.ImmutableSortedSet<BuildTarget> |
getConfigurationDeps()
Provides a set of configuration targets that were used during the construction of this node.
|
T |
getConstructorArg() |
com.google.common.collect.ImmutableSet<BuildTarget> |
getDeclaredDeps() |
BaseDescription<T> |
getDescription() |
default DependencyStack.Element |
getElement() |
com.google.common.collect.ImmutableSortedSet<BuildTarget> |
getExtraDeps() |
ProjectFilesystem |
getFilesystem() |
com.google.common.collect.ImmutableSet<ForwardRelativePath> |
getInputs()
Cell root-relative paths.
|
NodeCopier |
getNodeCopier() |
Set<BuildTarget> |
getParseDeps() |
RuleType |
getRuleType() |
Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> |
getSelectedVersions() |
com.google.common.collect.ImmutableSortedSet<BuildTarget> |
getTargetGraphOnlyDeps()
BuildTargetPaths which, when changed, may change the BuildRules produced by this TargetNode,
but whose steps don't need executing in order to build this TargetNode's BuildRules.
|
Set<BuildTarget> |
getTotalDeps()
Dependencies that include build targets as well as configuration targets that this node depends
on.
|
com.google.common.collect.ImmutableSet<VisibilityPattern> |
getVisibilityPatterns() |
com.google.common.collect.ImmutableSet<VisibilityPattern> |
getWithinViewPatterns() |
boolean |
isVisibleTo(TargetNode<?> viewer) |
void |
isVisibleToOrThrow(TargetNode<?> viewer) |
TargetNode<T> |
withBuildTarget(BuildTarget buildTarget) |
TargetNode<T> |
withConstructorArg(T constructorArg) |
TargetNode<T> |
withDeclaredDeps(Iterable<? extends BuildTarget> declaredDeps) |
TargetNode<T> |
withExtraDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps) |
TargetNode<T> |
withFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
This method copies this target node without applying logic in
ImplicitDepsInferringDescription |
TargetNode<T> |
withSelectedVersions(Optional<? extends com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions) |
TargetNode<T> |
withTargetGraphOnlyDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps) |
compareTo
getVisibilityChecker
BuildTarget getBuildTarget()
getBuildTarget
in interface HasBuildTarget
getBuildTarget
in interface ObeysVisibility
NodeCopier getNodeCopier()
BaseDescription<T> getDescription()
T getConstructorArg()
ProjectFilesystem getFilesystem()
com.google.common.collect.ImmutableSet<ForwardRelativePath> getInputs()
com.google.common.collect.ImmutableSet<BuildTarget> getDeclaredDeps()
com.google.common.collect.ImmutableSortedSet<BuildTarget> getExtraDeps()
com.google.common.collect.ImmutableSortedSet<BuildTarget> getTargetGraphOnlyDeps()
A TargetNode may require metadata from other targets in order to be constructed, but may not actually require those targets' build output. For example, some targets may execute queries against the TargetGraph (e.g. detecting the names of rules of a certain type) but don't use the output of those detected rules.
com.google.common.collect.ImmutableSortedSet<BuildTarget> getConfigurationDeps()
For example, this set would include configuration targets specified as keys in select
statements.
com.google.common.collect.ImmutableSet<VisibilityPattern> getVisibilityPatterns()
com.google.common.collect.ImmutableSet<VisibilityPattern> getWithinViewPatterns()
Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> getSelectedVersions()
Set<BuildTarget> getBuildDeps()
Set<BuildTarget> getParseDeps()
Set<BuildTarget> getTotalDeps()
boolean isVisibleTo(TargetNode<?> viewer)
void isVisibleToOrThrow(TargetNode<?> viewer)
RuleType getRuleType()
TargetNode<T> copyWithFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
ImplicitDepsInferringDescription
that may give
different results for deps based on flavors.
Note that this method strips away selected versions, and may be buggy because of it.
default TargetNode<T> copyWithFlavors(FlavorSet flavors)
TargetNode<T> withFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
ImplicitDepsInferringDescription
TargetNode<T> withBuildTarget(BuildTarget buildTarget)
TargetNode<T> withConstructorArg(T constructorArg)
TargetNode<T> withDeclaredDeps(Iterable<? extends BuildTarget> declaredDeps)
TargetNode<T> withExtraDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps)
TargetNode<T> withTargetGraphOnlyDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps)
TargetNode<T> withSelectedVersions(Optional<? extends com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions)
default DependencyStack.Element getElement()
getElement
in interface DependencyStack.ProvidesElement
default <U extends ConstructorArg> TargetNode<U> cast(Class<U> newArgClass)