public class PrebuiltJar extends AbstractBuildRuleWithDeclaredAndExtraDeps implements AndroidPackageable, ExportDependencies, InitializableFromDisk<JavaLibrary.Data>, JavaLibrary, MaybeRequiredForSourceOnlyAbi, SupportsInputBasedRuleKey
JavaLibrary.DataGWT_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, getTargetGraphOnlyDepsequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolverclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetSourceOnlyAbiJarisMavenCoordsPresentcompareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsgetTypeinputBasedRuleKeyIsEnabled, isSupportedpublic 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 MaybeRequiredForSourceOnlyAbipublic Optional<SourcePath> getSourceJar()
public boolean isDesugarEnabled()
HasDesugarSupportSuch as Lambda expressions, Method references, Repeating annotations
isDesugarEnabled in interface HasDesugarSupportpublic boolean isInterfaceMethodsDesugarEnabled()
HasDesugarSupportisInterfaceMethodsDesugarEnabled in interface HasDesugarSupportpublic 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>IOExceptionpublic BuildOutputInitializer<JavaLibrary.Data> getBuildOutputInitializer()
getBuildOutputInitializer in interface InitializableFromDisk<JavaLibrary.Data>public Set<BuildRule> getDepsForTransitiveClasspathEntries()
getDepsForTransitiveClasspathEntries in interface HasClasspathDepspublic com.google.common.collect.ImmutableSet<SourcePath> getTransitiveClasspaths()
getTransitiveClasspaths in interface HasClasspathEntriesjavac's -classpath flag
in order to build a jar associated with this rule.public com.google.common.collect.ImmutableSet<JavaLibrary> getTransitiveClasspathDeps()
getTransitiveClasspathDeps in interface HasClasspathEntriespublic com.google.common.collect.ImmutableSet<SourcePath> getImmediateClasspaths()
HasClasspathEntriesUsed to generate the value of HasClasspathEntries.getTransitiveClasspaths().
getImmediateClasspaths in interface HasClasspathEntriespublic com.google.common.collect.ImmutableSet<SourcePath> getOutputClasspaths()
getOutputClasspaths in interface HasClasspathEntriesjavac'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 JavaLibrarypublic com.google.common.collect.ImmutableSortedSet<SourcePath> getSources()
getSources in interface HasSourcespublic com.google.common.collect.ImmutableSortedSet<SourcePath> getResources()
getResources in interface JavaLibrarypublic Optional<String> getResourcesRoot()
getResourcesRoot in interface JavaLibrarypublic SortedSet<BuildRule> getExportedDeps()
getExportedDeps in interface ExportDependenciespublic SortedSet<BuildRule> getExportedProvidedDeps()
getExportedProvidedDeps in interface ExportDependenciespublic Optional<SourcePath> getGeneratedAnnotationSourcePath()
getGeneratedAnnotationSourcePath in interface JavaLibrarypublic boolean hasAnnotationProcessing()
hasAnnotationProcessing in interface JavaLibrarypublic boolean neverMarkAsUnusedDependency()
neverMarkAsUnusedDependency in interface JavaLibrarypublic java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDepspublic com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRulepublic Iterable<AndroidPackageable> getRequiredPackageables(BuildRuleResolver ruleResolver)
AndroidPackageableFor 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 AndroidPackageableAndroidPackageables that must be included along with this one.public void addToCollector(AndroidPackageableCollector collector)
AndroidPackageableImplementations 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 AndroidPackageablecollector - The AndroidPackageableCollector that will receive the content.public SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulepublic JavaAbiInfo getAbiInfo()
getAbiInfo in interface HasJavaAbipublic Optional<BuildTarget> getAbiJar()
getAbiJar in interface HasJavaAbiSourcePath representing the ABI Jar for this rule.public Optional<String> getMavenCoords()
HasMavenCoordinatesgetMavenCoords in interface HasMavenCoordinatespublic JavaClassHashesProvider getClassHashesProvider()
getClassHashesProvider in interface HasJavaClassHashes