public class CalculateSourceAbi extends PipelinedModernBuildRule<JavacPipelineState,CalculateSourceAbi.SourceAbiBuildable> implements CalculateAbi, InitializableFromDisk<Object>, SupportsDependencyFileRuleKey
| Modifier and Type | Class and Description |
|---|---|
static class |
CalculateSourceAbi.SourceAbiBuildable
Buildable implementation.
|
| Constructor and Description |
|---|
CalculateSourceAbi(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
JarBuildStepsFactory jarBuildStepsFactory,
SourcePathRuleFinder ruleFinder) |
getPipelinedBuildStepscompareTo, getBuildable, getBuildCellPathFactory, getBuildDeps, getBuildSteps, getOutputPathResolver, getSetupStepsForBuildable, getSourcePath, getSourcePaths, injectFieldsIfNecessary, inputBasedRuleKeyIsEnabled, recordOutputs, recordOutputs, recordOutputs, stepsForBuildable, stepsForBuildable, updateBuildRuleResolverequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, isCacheable, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAbiJargetSourceOnlyAbiJarcompareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsisSupportedisSupportedpublic CalculateSourceAbi(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, JarBuildStepsFactory jarBuildStepsFactory, SourcePathRuleFinder ruleFinder)
public SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulegetSourcePathToOutput in class ModernBuildRule<CalculateSourceAbi.SourceAbiBuildable>public JavaAbiInfo getAbiInfo()
getAbiInfo in interface HasJavaAbipublic String getType()
getType in interface HasNameAndTypegetType in class AbstractBuildRulepublic void invalidateInitializeFromDiskState()
invalidateInitializeFromDiskState in interface InitializableFromDisk<Object>public Object initializeFromDisk(SourcePathResolverAdapter pathResolver) throws IOException
initializeFromDisk in interface InitializableFromDisk<Object>IOExceptionpublic BuildOutputInitializer<Object> getBuildOutputInitializer()
getBuildOutputInitializer in interface InitializableFromDisk<Object>public boolean useRulePipelining()
useRulePipelining in interface SupportsPipelining<JavacPipelineState>@Nullable public SupportsPipelining<JavacPipelineState> getPreviousRuleInPipeline()
getPreviousRuleInPipeline in interface SupportsPipelining<JavacPipelineState>public RulePipelineStateFactory<JavacPipelineState> getPipelineStateFactory()
getPipelineStateFactory in interface SupportsPipelining<JavacPipelineState>public boolean useDependencyFileRuleKeys()
useDependencyFileRuleKeys in interface SupportsDependencyFileRuleKeypublic java.util.function.Predicate<SourcePath> getCoveredByDepFilePredicate(SourcePathResolverAdapter pathResolver)
SupportsDependencyFileRuleKeyI.e. this predicate should return true only for source paths that *may* be returned from
SupportsDependencyFileRuleKey.getInputsAfterBuildingLocally(BuildContext, CellPathResolver). This information is
used by the rule key builder to infer that inputs *not* in this list should be included
unconditionally in the rule key. Inputs that *are* in this list should be included in the rule
key if and only if they are actually being used for the rule. I.e. if they are present in the
dep-file listed by SupportsDependencyFileRuleKey.getInputsAfterBuildingLocally(BuildContext, CellPathResolver).
getCoveredByDepFilePredicate in interface SupportsDependencyFileRuleKeypublic java.util.function.Predicate<SourcePath> getExistenceOfInterestPredicate(SourcePathResolverAdapter pathResolver)
SupportsDependencyFileRuleKeyThe main purpose of this predicate is to support scenarios where compiler decides whether to use a file or not solely based on its path. Of course, if compiler decides to use the file, it should list it in the dep-file in which case both the path and the content will be included in the rule key. However, relying only on presence in the dep-file for such paths is not sufficient. The problem occurs when a new such file just gets added, in which case it won't be present in the dep-file produced in the previous build, and yet if we run a local build now the compiler may decide to use it. For that reason rule key needs to reflect existence of all such files and change when a such a file gets added or removed.
getExistenceOfInterestPredicate in interface SupportsDependencyFileRuleKeypublic com.google.common.collect.ImmutableList<SourcePath> getInputsAfterBuildingLocally(BuildContext context, CellPathResolver cellPathResolver)
SupportsDependencyFileRuleKeygetInputsAfterBuildingLocally in interface SupportsDependencyFileRuleKey