Interface BuildRule
-
- All Superinterfaces:
AllowsNonAnnotatedFields
,BuildEngineAction
,Comparable<BuildRule>
,HasNameAndType
- All Known Subinterfaces:
BinaryBuildRule
,BuildRuleWithBinary
,CxxIntermediateBuildProduct
,ExportDependencies
,ExternalTestRunnerRule
,HasAppleDebugSymbolDeps
,HasJavaClassHashes
,HasMavenCoordinates
,HasMultipleOutputs
,HasPostBuildSteps
,HasRuntimeDeps
,HasSupplementaryOutputs
,JavaLibrary
,JsBundleOutputs
,JsDependenciesOutputs
,MavenPublishable
,MaybeRequiredForSourceOnlyAbi
,OverrideScheduleRule
,SupportsDependencyFileRuleKey
,SupportsInputBasedRuleKey
,SupportsPipelining<T>
,TestRule
,TestXRule
- All Known Implementing Classes:
Aapt2Compile
,Aapt2Link
,AaptPackageResources
,AbstractBuildRule
,AbstractBuildRuleWithDeclaredAndExtraDeps
,AndroidAar
,AndroidAppModularity
,AndroidAppModularityVerification
,AndroidBinary
,AndroidBinaryExopackageSymlinkTree
,AndroidBinaryNonExoInstaller
,AndroidBuildConfig
,AndroidBundle
,AndroidInstrumentationApk
,AndroidInstrumentationTest
,AndroidLibrary
,AndroidManifest
,AndroidPrebuiltAar
,AndroidResource
,AndroidResourceIndex
,ApkGenrule
,AppleAssetCatalog
,AppleBundle
,AppleDebuggableBinary
,AppleDsym
,AppleTest
,AppleTestAggregatedDependencies
,AppleTestX
,AppleToolchainBuildRule
,AppleToolchainSetBuildRule
,Archive
,AssembleDirectories
,BaseGenrule
,BinaryWrapperRule
,BuiltinApplePackage
,CalculateClassAbi
,CalculateSourceAbi
,CalculateSourceAbiFromLibraryTarget
,CGoGenImport
,CGoGenSource
,CGoLibrary
,CommandAlias
,CompareAbis
,CopyNativeLibraries
,CoreDataModel
,CsharpLibrary
,CxxBinary
,CxxCompilationDatabase
,CxxGenrule
,CxxLibraryGroup
,CxxLink
,CxxLuaExtension
,CxxPrecompiledHeaderTemplate
,CxxPrefixHeader
,CxxPreprocessAndCompile
,CxxPythonExtension
,CxxStrip
,CxxTest
,CxxThinLTOIndex
,CxxThinLTOOpt
,DBinary
,DCompileBuildRule
,DefaultJavaLibrary
,DefaultWorkerToolRule
,DependencyAggregation
,DexProducedFromJavaLibrary
,DLibrary
,DTest
,DummyRDotJava
,ExopackageDeviceDirectoryLister
,ExopackageFilesInstaller
,ExopackageInstallFinisher
,ExopackageResourcesInstaller
,ExportFile
,ExternallyBuiltApplePackage
,ExternalTestRunner
,Filegroup
,GenAidl
,GenerateRDotJava
,GenerateStringResources
,Genrule
,GenruleBinary
,GoBinary
,GoCompile
,GoLibrary
,GoTest
,GoTestCoverSource
,GoTestMain
,GoTestRunner
,GoTestX
,GwtBinary
,GwtModule
,HalideCompile
,HalideLibrary
,HaskellBinary
,HaskellCompileRule
,HaskellGhciRule
,HaskellHaddockLibRule
,HaskellHaddockRule
,HaskellLibrary
,HaskellLinkRule
,HaskellPackageRule
,HeaderSymlinkTree
,HeaderSymlinkTreeWithHeaderMap
,HeaderSymlinkTreeWithModuleMap
,HttpArchive
,HttpFile
,HttpFileBinary
,InferNullsafe
,JarFattener
,JarGenrule
,JavaAnnotationProcessor
,JavaBinary
,Javadoc
,JavaSourceJar
,JavaTest
,JavaTestRunner
,JavaTestX
,JsBundle
,JsBundleAndroid
,JsBundleGenrule
,JsDependenciesFile
,JsFile
,JsLibrary
,JsonConcatenate
,Keystore
,LuaBinary
,LuaLibrary
,LuaStandaloneBinary
,MachoDylibStubRule
,MappedSymlinkTree
,MavenUberJar
,MavenUberJar.SourceJar
,MergeAndroidResourceSources
,MergeAssets
,MergeThirdPartyJarResources
,ModernBuildRule
,MultiarchFile
,NativeLibraryProguardGenerator
,NdkLibrary
,NdkToolchainBuildRule
,NoopBuildRule
,NoopBuildRuleWithDeclaredAndExtraDeps
,OcamlBinary
,OcamlBuild
,OcamlCCompile
,OcamlClean
,OcamlDebugLauncher
,OcamlLibrary
,OcamlLink
,OcamlMLCompile
,PackageStringAssets
,PipelinedModernBuildRule
,PrebuiltAppleFramework
,PrebuiltCxxLibrary
,PrebuiltCxxLibraryGroupDescription.CustomPrebuiltCxxLibrary
,PrebuiltDotnetLibrary
,PrebuiltHaskellLibrary
,PrebuiltJar
,PrebuiltNativeLibrary
,PrebuiltPythonLibrary
,PreDexMerge
,PreDexSingleDexMerge
,PreDexSplitDexGroup
,PreDexSplitDexMerge
,PreInclude
,PythonBinary
,PythonCompileRule
,PythonInPlaceBinary
,PythonLibrary
,PythonPackagedBinary
,PythonSymlinkTree
,PythonTest
,PythonTestRunner
,PythonTestX
,RemoteFile
,RemoteFileBinary
,ResourcesFilter
,RobolectricTest
,RobolectricTestX
,RuleAnalysisLegacyBinaryBuildRuleView
,RuleAnalysisLegacyBuildRuleView
,RuleAnalysisLegacyTestBuildRuleView
,RustCompileRule
,RustLibrary
,RustTest
,SceneKitAssets
,ShBinary
,ShTest
,SplitResources
,SplitUberRDotJavaJar
,StandardJavacPlugin
,StripLinkable
,SwiftCompile
,SwiftToolchainBuildRule
,SymlinkTree
,TestSuite
,UnitTestOptions
,UnstrippedNativeLibraries
,UnzipAar
,WriteFile
,WriteFileHashCode
,WriteStringTemplateRule
,Zip
public interface BuildRule extends Comparable<BuildRule>, AllowsNonAnnotatedFields, BuildEngineAction, HasNameAndType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
compareTo(BuildRule that)
SortedSet<BuildRule>
getBuildDeps()
com.google.common.collect.ImmutableList<? extends Step>
getBuildSteps(BuildContext context, BuildableContext buildableContext)
BuildTarget
getBuildTarget()
default String
getFullyQualifiedName()
ProjectFilesystem
getProjectFilesystem()
SourcePath
getSourcePathToOutput()
boolean
hasBuildSteps()
Whether thisBuildRule
may have any steps to build.boolean
isCacheable()
Whether thisBuildRule
can be cached.default boolean
outputFileCanBeCopied()
default boolean
shouldRespectInputSizeLimitForRemoteExecution()
String
toString()
void
updateBuildRuleResolver(BuildRuleResolver ruleResolver)
Updates the BuildRuleResolver and associated objects for this build rule.-
Methods inherited from interface com.facebook.buck.core.build.action.BuildEngineAction
getDependencies, getSourcePathOutputs
-
Methods inherited from interface com.facebook.buck.core.rules.HasNameAndType
getType
-
-
-
-
Method Detail
-
getBuildTarget
BuildTarget getBuildTarget()
- Specified by:
getBuildTarget
in interfaceBuildEngineAction
- Returns:
- the
BuildTarget
of the rule corresponding to this action
-
getFullyQualifiedName
default String getFullyQualifiedName()
- Specified by:
getFullyQualifiedName
in interfaceHasNameAndType
-
getBuildDeps
SortedSet<BuildRule> getBuildDeps()
- Returns:
- the set of rules that must be built before this rule. Normally, this matches the value
of the
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 inandroid_binary
). In these cases, the implicit dependencies are also included in the set returned by this method. The value of the originaldeps
argument, as defined in the build file, must be accessed via a custom getter provided by the build rule.
-
toString
String toString()
- Overrides:
toString
in classObject
- Returns:
- the same value as
getFullyQualifiedName()
-
getBuildSteps
com.google.common.collect.ImmutableList<? extends Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
-
getSourcePathToOutput
@Nullable SourcePath getSourcePathToOutput()
-
outputFileCanBeCopied
default boolean outputFileCanBeCopied()
- Returns:
- true if the output of this build rule is compatible with
buck build --out
. To be compatible, that means (1)getSourcePathToOutput()
cannot returnnull
, and (2) the output file works as intended when copied to an arbitrary path (i.e., does not have any dependencies on relative symlinks).
-
getProjectFilesystem
ProjectFilesystem getProjectFilesystem()
-
isCacheable
boolean isCacheable()
Whether thisBuildRule
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.- Specified by:
isCacheable
in interfaceBuildEngineAction
-
hasBuildSteps
boolean hasBuildSteps()
Whether thisBuildRule
may have any steps to build.
-
compareTo
default int compareTo(BuildRule that)
- Specified by:
compareTo
in interfaceComparable<BuildRule>
-
updateBuildRuleResolver
void updateBuildRuleResolver(BuildRuleResolver ruleResolver)
Updates the BuildRuleResolver and associated objects for this build rule.Build 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.
-
shouldRespectInputSizeLimitForRemoteExecution
default boolean shouldRespectInputSizeLimitForRemoteExecution()
- Specified by:
shouldRespectInputSizeLimitForRemoteExecution
in interfaceBuildEngineAction
- Returns:
- true if this rule should only be allowed to be executed via Remote Execution if it satisfies input size limits.
-
-