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) |
getPipelinedBuildSteps
compareTo, getBuildable, getBuildCellPathFactory, getBuildDeps, getBuildSteps, getOutputPathResolver, getSetupStepsForBuildable, getSourcePath, getSourcePaths, injectFieldsIfNecessary, inputBasedRuleKeyIsEnabled, recordOutputs, recordOutputs, recordOutputs, stepsForBuildable, stepsForBuildable, updateBuildRuleResolver
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, isCacheable, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAbiJar
getSourceOnlyAbiJar
compareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
isSupported
isSupported
public CalculateSourceAbi(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, JarBuildStepsFactory jarBuildStepsFactory, SourcePathRuleFinder ruleFinder)
public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
getSourcePathToOutput
in class ModernBuildRule<CalculateSourceAbi.SourceAbiBuildable>
public JavaAbiInfo getAbiInfo()
getAbiInfo
in interface HasJavaAbi
public String getType()
getType
in interface HasNameAndType
getType
in class AbstractBuildRule
public void invalidateInitializeFromDiskState()
invalidateInitializeFromDiskState
in interface InitializableFromDisk<Object>
public Object initializeFromDisk(SourcePathResolverAdapter pathResolver) throws IOException
initializeFromDisk
in interface InitializableFromDisk<Object>
IOException
public 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 SupportsDependencyFileRuleKey
public java.util.function.Predicate<SourcePath> getCoveredByDepFilePredicate(SourcePathResolverAdapter pathResolver)
SupportsDependencyFileRuleKey
I.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 SupportsDependencyFileRuleKey
public java.util.function.Predicate<SourcePath> getExistenceOfInterestPredicate(SourcePathResolverAdapter pathResolver)
SupportsDependencyFileRuleKey
The 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 SupportsDependencyFileRuleKey
public com.google.common.collect.ImmutableList<SourcePath> getInputsAfterBuildingLocally(BuildContext context, CellPathResolver cellPathResolver)
SupportsDependencyFileRuleKey
getInputsAfterBuildingLocally
in interface SupportsDependencyFileRuleKey