public abstract class TargetNodeImpl<T extends ConstructorArg> extends Object implements TargetNode<T>
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.| Constructor and Description |
|---|
TargetNodeImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
check() |
int |
compareTo(TargetNode<?> o) |
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() |
abstract BuildTarget |
getBuildTarget() |
abstract com.google.common.collect.ImmutableSortedSet<BuildTarget> |
getConfigurationDeps()
Provides a set of configuration targets that were used during the construction of this node.
|
abstract T |
getConstructorArg() |
abstract com.google.common.collect.ImmutableSet<BuildTarget> |
getDeclaredDeps() |
abstract BaseDescription<T> |
getDescription() |
abstract com.google.common.collect.ImmutableSortedSet<BuildTarget> |
getExtraDeps() |
abstract ProjectFilesystem |
getFilesystem() |
abstract com.google.common.collect.ImmutableSet<ForwardRelativePath> |
getInputs()
Cell root-relative paths.
|
abstract NodeCopier |
getNodeCopier() |
Set<BuildTarget> |
getParseDeps() |
RuleType |
getRuleType() |
abstract Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> |
getSelectedVersions() |
abstract 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.
|
VisibilityChecker |
getVisibilityChecker() |
abstract com.google.common.collect.ImmutableSet<VisibilityPattern> |
getVisibilityPatterns() |
abstract com.google.common.collect.ImmutableSet<VisibilityPattern> |
getWithinViewPatterns() |
boolean |
isVisibleTo(TargetNode<?> viewer) |
void |
isVisibleToOrThrow(TargetNode<?> viewer) |
static <T extends ConstructorArg> |
of(BuildTarget buildTarget,
NodeCopier nodeCopier,
BaseDescription<T> description,
T constructorArg,
ProjectFilesystem filesystem,
com.google.common.collect.ImmutableSet<ForwardRelativePath> inputs,
com.google.common.collect.ImmutableSet<BuildTarget> declaredDeps,
com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps,
com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps,
com.google.common.collect.ImmutableSortedSet<BuildTarget> configurationDeps,
com.google.common.collect.ImmutableSet<VisibilityPattern> visibilityPatterns,
com.google.common.collect.ImmutableSet<VisibilityPattern> withinViewPatterns,
Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions) |
String |
toString() |
TargetNodeImpl<T> |
withBuildTarget(BuildTarget buildTarget) |
TargetNodeImpl<T> |
withConstructorArg(T constructorArg) |
TargetNodeImpl<T> |
withDeclaredDeps(Iterable<? extends BuildTarget> declaredDeps) |
TargetNodeImpl<T> |
withExtraDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps) |
TargetNodeImpl<T> |
withFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
This method copies this target node without applying logic in
ImplicitDepsInferringDescription |
TargetNodeImpl<T> |
withSelectedVersions(Optional<? extends com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions) |
TargetNodeImpl<T> |
withTargetGraphOnlyDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcast, copyWithFlavors, getElement@Value.Check protected void check()
public abstract BuildTarget getBuildTarget()
getBuildTarget in interface HasBuildTargetgetBuildTarget in interface TargetNode<T extends ConstructorArg>getBuildTarget in interface ObeysVisibilitypublic abstract NodeCopier getNodeCopier()
getNodeCopier in interface TargetNode<T extends ConstructorArg>@Value.Auxiliary public abstract BaseDescription<T> getDescription()
getDescription in interface TargetNode<T extends ConstructorArg>public abstract T getConstructorArg()
getConstructorArg in interface TargetNode<T extends ConstructorArg>public abstract ProjectFilesystem getFilesystem()
getFilesystem in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSet<ForwardRelativePath> getInputs()
TargetNodegetInputs in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSet<BuildTarget> getDeclaredDeps()
getDeclaredDeps in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSortedSet<BuildTarget> getExtraDeps()
getExtraDeps in interface TargetNode<T extends ConstructorArg>public abstract 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.
getTargetGraphOnlyDeps in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSortedSet<BuildTarget> getConfigurationDeps()
TargetNodeFor example, this set would include configuration targets specified as keys in select statements.
getConfigurationDeps in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSet<VisibilityPattern> getVisibilityPatterns()
getVisibilityPatterns in interface TargetNode<T extends ConstructorArg>public abstract com.google.common.collect.ImmutableSet<VisibilityPattern> getWithinViewPatterns()
getWithinViewPatterns in interface TargetNode<T extends ConstructorArg>public abstract Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> getSelectedVersions()
getSelectedVersions in interface TargetNode<T extends ConstructorArg>@Value.Lazy public VisibilityChecker getVisibilityChecker()
getVisibilityChecker in interface ObeysVisibilitypublic Set<BuildTarget> getBuildDeps()
getBuildDeps in interface TargetNode<T extends ConstructorArg>public Set<BuildTarget> getParseDeps()
getParseDeps in interface TargetNode<T extends ConstructorArg>public Set<BuildTarget> getTotalDeps()
TargetNodegetTotalDeps in interface TargetNode<T extends ConstructorArg>public boolean isVisibleTo(TargetNode<?> viewer)
isVisibleTo in interface TargetNode<T extends ConstructorArg>public void isVisibleToOrThrow(TargetNode<?> viewer)
isVisibleToOrThrow in interface TargetNode<T extends ConstructorArg>public RuleType getRuleType()
getRuleType in interface TargetNode<T extends ConstructorArg>public int compareTo(TargetNode<?> o)
compareTo in interface Comparable<TargetNode<?>>public TargetNode<T> copyWithFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
TargetNodeImplicitDepsInferringDescription 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.
copyWithFlavors in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withFlavors(com.google.common.collect.ImmutableSet<Flavor> flavors)
TargetNodeImplicitDepsInferringDescriptionwithFlavors in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withBuildTarget(BuildTarget buildTarget)
withBuildTarget in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withConstructorArg(T constructorArg)
withConstructorArg in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withDeclaredDeps(Iterable<? extends BuildTarget> declaredDeps)
withDeclaredDeps in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withExtraDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps)
withExtraDeps in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withTargetGraphOnlyDeps(com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps)
withTargetGraphOnlyDeps in interface TargetNode<T extends ConstructorArg>public TargetNodeImpl<T> withSelectedVersions(Optional<? extends com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions)
withSelectedVersions in interface TargetNode<T extends ConstructorArg>public static <T extends ConstructorArg> TargetNodeImpl<T> of(BuildTarget buildTarget, NodeCopier nodeCopier, BaseDescription<T> description, T constructorArg, ProjectFilesystem filesystem, com.google.common.collect.ImmutableSet<ForwardRelativePath> inputs, com.google.common.collect.ImmutableSet<BuildTarget> declaredDeps, com.google.common.collect.ImmutableSortedSet<BuildTarget> extraDeps, com.google.common.collect.ImmutableSortedSet<BuildTarget> targetGraphOnlyDeps, com.google.common.collect.ImmutableSortedSet<BuildTarget> configurationDeps, com.google.common.collect.ImmutableSet<VisibilityPattern> visibilityPatterns, com.google.common.collect.ImmutableSet<VisibilityPattern> withinViewPatterns, Optional<com.google.common.collect.ImmutableMap<BuildTarget,Version>> selectedVersions)