public class NoopBuildRule extends AbstractBuildRule implements SupportsInputBasedRuleKey
BuildRule
which has no output. This is used in the following ways:
TestRule
s may not have any build steps to perform, but
have runTests Steps to run to determine their exit code.
Constructor and Description |
---|
NoopBuildRule(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem) |
Modifier and Type | Method and Description |
---|---|
SortedSet<BuildRule> |
getBuildDeps() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
SourcePath |
getSourcePathToOutput() |
boolean |
hasBuildSteps()
Whether this
BuildRule may have any steps to build. |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hashCode, injectFields, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
inputBasedRuleKeyIsEnabled, isSupported
compareTo, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
public NoopBuildRule(BuildTarget buildTarget, ProjectFilesystem projectFilesystem)
public final SortedSet<BuildRule> getBuildDeps()
getBuildDeps
in interface BuildRule
deps
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.
public final com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
public final boolean hasBuildSteps()
BuildRule
BuildRule
may have any steps to build.hasBuildSteps
in interface BuildRule
hasBuildSteps
in class AbstractBuildRule
@Nullable public final SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public final boolean isCacheable()
BuildRule
BuildRule
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 BuildEngineAction
isCacheable
in interface BuildRule
isCacheable
in class AbstractBuildRule