public class PrebuiltJar extends AbstractBuildRuleWithDeclaredAndExtraDeps implements AndroidPackageable, ExportDependencies, InitializableFromDisk<JavaLibrary.Data>, JavaLibrary, MaybeRequiredForSourceOnlyAbi, SupportsInputBasedRuleKey
JavaLibrary.Data
GWT_MODULE_FLAVOR, MAVEN_JAR, SRC_JAR
Constructor and Description |
---|
PrebuiltJar(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams params,
SourcePathResolverAdapter resolver,
SourcePath binaryJar,
Optional<SourcePath> sourceJar,
Optional<SourcePath> gwtJar,
Optional<String> javadocUrl,
Optional<String> mavenCoords,
boolean provided,
boolean requiredForSourceOnlyAbi,
boolean generateAbi,
boolean neverMarkAsUnusedDependency) |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDeps
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getSourceOnlyAbiJar
isMavenCoordsPresent
compareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
inputBasedRuleKeyIsEnabled, isSupported
public PrebuiltJar(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params, SourcePathResolverAdapter resolver, SourcePath binaryJar, Optional<SourcePath> sourceJar, Optional<SourcePath> gwtJar, Optional<String> javadocUrl, Optional<String> mavenCoords, boolean provided, boolean requiredForSourceOnlyAbi, boolean generateAbi, boolean neverMarkAsUnusedDependency)
public boolean getRequiredForSourceOnlyAbi()
getRequiredForSourceOnlyAbi
in interface MaybeRequiredForSourceOnlyAbi
public Optional<SourcePath> getSourceJar()
public boolean isDesugarEnabled()
HasDesugarSupport
Such as Lambda expressions, Method references, Repeating annotations
isDesugarEnabled
in interface HasDesugarSupport
public boolean isInterfaceMethodsDesugarEnabled()
HasDesugarSupport
isInterfaceMethodsDesugarEnabled
in interface HasDesugarSupport
public com.google.common.collect.ImmutableSortedMap<String,com.google.common.hash.HashCode> getClassNamesToHashes()
getClassNamesToHashes
in interface HasJavaClassHashes
.class
files in the output of this rule to
SHA-1 hashes of their contents.public void invalidateInitializeFromDiskState()
invalidateInitializeFromDiskState
in interface InitializableFromDisk<JavaLibrary.Data>
public JavaLibrary.Data initializeFromDisk(SourcePathResolverAdapter pathResolver) throws IOException
initializeFromDisk
in interface InitializableFromDisk<JavaLibrary.Data>
IOException
public BuildOutputInitializer<JavaLibrary.Data> getBuildOutputInitializer()
getBuildOutputInitializer
in interface InitializableFromDisk<JavaLibrary.Data>
public Set<BuildRule> getDepsForTransitiveClasspathEntries()
getDepsForTransitiveClasspathEntries
in interface HasClasspathDeps
public com.google.common.collect.ImmutableSet<SourcePath> getTransitiveClasspaths()
getTransitiveClasspaths
in interface HasClasspathEntries
javac
's -classpath
flag
in order to build a jar associated with this rule.public com.google.common.collect.ImmutableSet<JavaLibrary> getTransitiveClasspathDeps()
getTransitiveClasspathDeps
in interface HasClasspathEntries
public com.google.common.collect.ImmutableSet<SourcePath> getImmediateClasspaths()
HasClasspathEntries
Used to generate the value of HasClasspathEntries.getTransitiveClasspaths()
.
getImmediateClasspaths
in interface HasClasspathEntries
public com.google.common.collect.ImmutableSet<SourcePath> getOutputClasspaths()
getOutputClasspaths
in interface HasClasspathEntries
javac
's
-classpath
flag in order to compile rules that depend on this rule. This is a
superset of getImmediateClasspaths
which also contains the classpath entries of any
exported deps.public com.google.common.collect.ImmutableSortedSet<SourcePath> getJavaSrcs()
getJavaSrcs
in interface JavaLibrary
public com.google.common.collect.ImmutableSortedSet<SourcePath> getSources()
getSources
in interface HasSources
public com.google.common.collect.ImmutableSortedSet<SourcePath> getResources()
getResources
in interface JavaLibrary
public Optional<String> getResourcesRoot()
getResourcesRoot
in interface JavaLibrary
public SortedSet<BuildRule> getExportedDeps()
getExportedDeps
in interface ExportDependencies
public SortedSet<BuildRule> getExportedProvidedDeps()
getExportedProvidedDeps
in interface ExportDependencies
public Optional<SourcePath> getGeneratedAnnotationSourcePath()
getGeneratedAnnotationSourcePath
in interface JavaLibrary
public boolean hasAnnotationProcessing()
hasAnnotationProcessing
in interface JavaLibrary
public boolean neverMarkAsUnusedDependency()
neverMarkAsUnusedDependency
in interface JavaLibrary
public java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps
in interface HasRuntimeDeps
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
public Iterable<AndroidPackageable> getRequiredPackageables(BuildRuleResolver ruleResolver)
AndroidPackageable
For example, an android_library will need all of its Java deps (except provided_deps), its resource deps, and its native library deps (even though it doesn't need the native library as a build-time dependency). An android_resource might need an android_library that declares a custom view that it references, as well as other android_resource rules that it references directly.
TODO(natthu): Once build rules and buildables are merged, replace this method with another
interface that lets an AndroidPackageable
override the default set which is all deps of
the type AndroidPackageable
.
getRequiredPackageables
in interface AndroidPackageable
AndroidPackageable
s that must be included along with this one.public void addToCollector(AndroidPackageableCollector collector)
AndroidPackageable
Implementations should call methods on the collector specify what concrete content must be included in an Android package that includes this object. For example, an android_library will add Java classes, an ndk_library will add native libraries, and android_resource will add resource directories.
addToCollector
in interface AndroidPackageable
collector
- The AndroidPackageableCollector
that will receive the content.public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public JavaAbiInfo getAbiInfo()
getAbiInfo
in interface HasJavaAbi
public Optional<BuildTarget> getAbiJar()
getAbiJar
in interface HasJavaAbi
SourcePath
representing the ABI Jar for this rule.public Optional<String> getMavenCoords()
HasMavenCoordinates
getMavenCoords
in interface HasMavenCoordinates
public JavaClassHashesProvider getClassHashesProvider()
getClassHashesProvider
in interface HasJavaClassHashes