public class SymlinkTree extends AbstractBuildRule implements HasRuntimeDeps, SupportsInputBasedRuleKey
| Modifier and Type | Field and Description |
|---|---|
protected String |
category |
protected Path |
root |
protected String |
type |
| Constructor and Description |
|---|
SymlinkTree(String category,
BuildTarget target,
ProjectFilesystem filesystem,
Path root,
com.google.common.collect.ImmutableMap<Path,SourcePath> links) |
SymlinkTree(String category,
BuildTarget target,
ProjectFilesystem filesystem,
SourcePathRuleFinder finder,
Path root,
Symlinks links) |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<BuildRule> |
getBuildDeps() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
protected SymlinkPaths |
getResolvedSymlinks(SourcePathResolverAdapter resolver) |
Path |
getRoot() |
SourcePath |
getRootSourcePath() |
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToOutput() |
String |
getType() |
protected Step |
getVerifyStep(SymlinkPaths links) |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
static com.google.common.collect.ImmutableBiMap<SourcePath,Path> |
resolveDuplicateRelativePaths(com.google.common.collect.ImmutableSortedSet<SourcePath> sourcePaths,
SourcePathResolverAdapter resolver)
Because of cross-cell, multiple
SourcePaths can resolve to the same relative path,
despite having distinct absolute paths. |
protected boolean |
shouldDeleteExistingSymlink(ProjectFilesystem filesystem,
Path path) |
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, toString, updateBuildRuleResolverclone, finalize, getClass, notify, notifyAll, wait, wait, waitinputBasedRuleKeyIsEnabled, isSupportedcompareTo, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsprotected final String category
protected final Path root
protected final String type
public SymlinkTree(String category, BuildTarget target, ProjectFilesystem filesystem, SourcePathRuleFinder finder, Path root, Symlinks links)
public SymlinkTree(String category, BuildTarget target, ProjectFilesystem filesystem, Path root, com.google.common.collect.ImmutableMap<Path,SourcePath> links)
public static com.google.common.collect.ImmutableBiMap<SourcePath,Path> resolveDuplicateRelativePaths(com.google.common.collect.ImmutableSortedSet<SourcePath> sourcePaths, SourcePathResolverAdapter resolver)
SourcePaths can resolve to the same relative path,
despite having distinct absolute paths. This presents a challenge for rules that require
gathering all of the inputs in one directory.sourcePaths - set of SourcePaths to processpublic String getType()
getType in interface HasNameAndTypegetType in class AbstractBuildRulepublic SortedSet<BuildRule> getBuildDeps()
getBuildDeps in interface BuildRuledeps argument for this build rule in the build file in which it was defined.
However, there are special cases where other arguments pull in implicit dependencies
(e.g., the keystore argument in android_binary). In these cases, the
implicit dependencies are also included in the set returned by this method. The value of
the original deps argument, as defined in the build file, must be accessed via a
custom getter provided by the build rule.
protected SymlinkPaths getResolvedSymlinks(SourcePathResolverAdapter resolver)
protected boolean shouldDeleteExistingSymlink(ProjectFilesystem filesystem, Path path)
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRulepublic SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRuleprotected Step getVerifyStep(SymlinkPaths links)
public boolean isCacheable()
BuildRuleBuildRule can be cached.
Uncached build rules are never written out to cache, never read from cache, and does not count in cache statistics. This rule is useful for artifacts which cannot be easily normalized.
Uncached rules are not always rebuilt, however, as long as the existing on-disk
representation is up to date. This means that these rules can take advantage of SupportsInputBasedRuleKey to prevent rebuilding.
isCacheable in interface BuildEngineActionisCacheable in interface BuildRuleisCacheable in class AbstractBuildRulepublic Path getRoot()
public SourcePath getRootSourcePath()
public java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDeps