public class RuleAnalysisLegacyBuildRuleView extends AbstractBuildRule implements SupportsInputBasedRuleKey, HasMultipleOutputs
RuleAnalysisResult in the modern action framework as a legacy BuildRule so that existing architecture can use them.
TODO(bobyf): figure out how to propagate provider info from here TODO(bobyf): make this a
ModernBuildRule
| Constructor and Description |
|---|
RuleAnalysisLegacyBuildRuleView(String type,
BuildTarget buildTarget,
Optional<Action> action,
BuildRuleResolver ruleResolver,
ProjectFilesystem projectFilesystem,
ProviderInfoCollection providerInfoCollection) |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<BuildRule> |
getBuildDeps() |
com.google.common.collect.ImmutableList<? extends Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
com.google.common.collect.ImmutableSet<OutputLabel> |
getOutputLabels()
returns a set of
OutputLabel instances associated with this build rule. |
ProviderInfoCollection |
getProviderInfos() |
SourcePath |
getSourcePathToOutput() |
com.google.common.collect.ImmutableSortedSet<SourcePath> |
getSourcePathToOutput(OutputLabel outputLabel)
Returns
SourcePath instances to the outputs associated with the given output label, or
null if the output label does not exist. |
String |
getType() |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
void |
updateBuildRuleResolver(BuildRuleResolver ruleResolver)
Updates the BuildRuleResolver and associated objects for this build rule.
|
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitinputBasedRuleKeyIsEnabled, isSupportedcompareTo, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toStringgetDependencies, getSourcePathOutputspublic RuleAnalysisLegacyBuildRuleView(String type, BuildTarget buildTarget, Optional<Action> action, BuildRuleResolver ruleResolver, ProjectFilesystem projectFilesystem, ProviderInfoCollection providerInfoCollection)
type - the type of this BuildRulebuildTarget - the BuildTarget of this analysis ruleaction - the action of the result for which we want to provide the BuildRule viewruleResolver - the current BuildRuleResolver to query dependent rulesprojectFilesystem - the filesystemproviderInfoCollection - the providers returned by this build targetpublic 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.
public com.google.common.collect.ImmutableList<? extends Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRule@Nullable public SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface HasMultipleOutputsgetSourcePathToOutput in interface BuildRulepublic com.google.common.collect.ImmutableSortedSet<SourcePath> getSourcePathToOutput(OutputLabel outputLabel)
HasMultipleOutputsSourcePath instances to the outputs associated with the given output label, or
null if the output label does not exist. If the default output label is given, returns
the default outputs associated with the rule.getSourcePathToOutput in interface HasMultipleOutputspublic com.google.common.collect.ImmutableSet<OutputLabel> getOutputLabels()
HasMultipleOutputsOutputLabel instances associated with this build rule.getOutputLabels in interface HasMultipleOutputspublic 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 void updateBuildRuleResolver(BuildRuleResolver ruleResolver)
BuildRuleBuild rules sometimes hold field references to build rule resolvers. If this build rule is to be cached, it must update its BuildRuleResolver when a new action graph is constructed to avoid leaking the entire action graph it was originally associated with.
updateBuildRuleResolver in interface BuildRuleupdateBuildRuleResolver in class AbstractBuildRulepublic ProviderInfoCollection getProviderInfos()
ProviderInfoCollection returned from rule analysis