public class RuleAnalysisCompatibleDelegatingActionGraphBuilder extends AbstractActionGraphBuilder implements RuleAnalysisGraph
ActionGraphBuilder that manages both rule analysis computation and the legacy action
graph construction.
This builder delegates to the new RuleAnalysisGraph and ActionGraphBuilder as
appropriate depending on the rule that is requested.
It satisfies the API of both computations to provide compatibility between them
| Constructor and Description |
|---|
RuleAnalysisCompatibleDelegatingActionGraphBuilder(TargetNodeToBuildRuleTransformer buildRuleGenerator,
java.util.function.Function<TargetNodeToBuildRuleTransformer,ActionGraphBuilder> delegateBuilderConstructor,
RuleAnalysisGraph delegateRuleAnalysisComputation) |
| Modifier and Type | Method and Description |
|---|---|
<T extends BuildRule> |
addToIndex(T buildRule)
Deprecated.
|
BuildRule |
computeIfAbsent(BuildTarget target,
java.util.function.Function<BuildTarget,BuildRule> mappingFunction)
Retrieve the
BuildRule for the given BuildTarget. |
RuleAnalysisResult |
get(RuleAnalysisKey lookupKey)
Finds the
RuleAnalysisResult of the given RuleAnalysisKey, starting computation
as necessary. |
com.google.common.collect.ImmutableMap<RuleAnalysisKey,RuleAnalysisResult> |
getAll(Set<RuleAnalysisKey> lookupKeys)
same as
RuleAnalysisGraph.get(RuleAnalysisKey) but for multiple RuleAnalysisKeys |
Iterable<BuildRule> |
getBuildRules() |
Parallelizer |
getParallelizer()
Returns a parallelizer object that parallelizes if the current BuildRuleResolver supports
parallelism.
|
Optional<BuildRule> |
getRuleOptional(BuildTarget buildTarget)
Returns the
BuildRule associated with the given BuildTarget if it is already
present. |
Iterable<BuildRule> |
getSuccessfullyConstructedBuildRules() |
void |
invalidate()
Invalidates this object.
|
<T> Optional<T> |
requireMetadata(BuildTarget target,
Class<T> metadataClass)
Retrieve a piece of metadata for a target.
|
BuildRule |
requireRule(BuildTarget target)
Retrieve the
BuildRule for the given BuildTarget. |
com.google.common.util.concurrent.ListenableFuture<BuildRule> |
requireRuleFuture(BuildTarget target) |
checkRuleIsBuiltForCorrectTarget, computeAllIfAbsent, requireAllRulesfilterBuildRuleInputs, filterBuildRuleInputs, filterBuildRuleInputs, filterBuildRuleInputs, getAllRules, getRule, getRule, getRule, getRuleOptionalWithType, getRuleWithType, getSourcePathResolverclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllRules, getRule, getRuleOptionalWithType, getRuleWithTypefilterBuildRuleInputs, filterBuildRuleInputs, filterBuildRuleInputs, filterBuildRuleInputs, getRule, getRule, getSourcePathResolverpublic RuleAnalysisCompatibleDelegatingActionGraphBuilder(TargetNodeToBuildRuleTransformer buildRuleGenerator, java.util.function.Function<TargetNodeToBuildRuleTransformer,ActionGraphBuilder> delegateBuilderConstructor, RuleAnalysisGraph delegateRuleAnalysisComputation)
public Iterable<BuildRule> getBuildRules()
getBuildRules in interface ActionGraphBuilderpublic Iterable<BuildRule> getSuccessfullyConstructedBuildRules()
getSuccessfullyConstructedBuildRules in interface ActionGraphBuilderpublic BuildRule computeIfAbsent(BuildTarget target, java.util.function.Function<BuildTarget,BuildRule> mappingFunction)
ActionGraphBuilderBuildRule for the given BuildTarget. If no rules are associated
with the target, compute the rule using the given supplier and update the mapping.computeIfAbsent in interface ActionGraphBuildertarget - target with which the BuildRule is associated.mappingFunction - function to compute the rule.public BuildRule requireRule(BuildTarget target)
ActionGraphBuilderBuildRule for the given BuildTarget. If no rules are associated
with the target, compute it by transforming the TargetNode associated with this build
target using the TargetNodeToBuildRuleTransformer associated with this
instance.requireRule in interface ActionGraphBuilderpublic com.google.common.util.concurrent.ListenableFuture<BuildRule> requireRuleFuture(BuildTarget target)
requireRuleFuture in interface ActionGraphBuilderrequireRuleFuture in class AbstractActionGraphBuilderpublic <T> Optional<T> requireMetadata(BuildTarget target, Class<T> metadataClass)
ActionGraphBuilderMetadataProvidingDescription.createMetadata(com.facebook.buck.core.model.BuildTarget, com.facebook.buck.core.rules.ActionGraphBuilder, com.facebook.buck.core.cell.CellPathResolver, T, java.util.Optional<com.google.common.collect.ImmutableMap<com.facebook.buck.core.model.BuildTarget, com.facebook.buck.versions.Version>>, java.lang.Class<U>).requireMetadata in interface ActionGraphBuilder@Deprecated public <T extends BuildRule> T addToIndex(T buildRule)
ActionGraphBuilderbuildRule's target to itself and returns buildRule.
Please use computeIfAbsent instead
addToIndex in interface ActionGraphBuilderpublic Parallelizer getParallelizer()
ActionGraphBuildergetParallelizer in interface ActionGraphBuilderpublic void invalidate()
ActionGraphBuilderinvalidate in interface ActionGraphBuilderpublic Optional<BuildRule> getRuleOptional(BuildTarget buildTarget)
BuildRuleResolverBuildRule associated with the given BuildTarget if it is already
present.getRuleOptional in interface BuildRuleResolverpublic RuleAnalysisResult get(RuleAnalysisKey lookupKey)
RuleAnalysisGraphRuleAnalysisResult of the given RuleAnalysisKey, starting computation
as necessary. All dependencies required will also be transformed, and cached.get in interface RuleAnalysisGraphlookupKey - the RuleAnalysisKey to find the result forRuleAnalysisResult from analyzing the given RuleAnalysisKeypublic com.google.common.collect.ImmutableMap<RuleAnalysisKey,RuleAnalysisResult> getAll(Set<RuleAnalysisKey> lookupKeys)
RuleAnalysisGraphRuleAnalysisGraph.get(RuleAnalysisKey) but for multiple RuleAnalysisKeysgetAll in interface RuleAnalysisGraph