public class DexProducedFromJavaLibrary extends ModernBuildRule<com.facebook.buck.android.DexProducedFromJavaLibrary.Impl> implements InitializableFromDisk<com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput>
DexProducedFromJavaLibrary is a BuildRule that serves a very specific purpose: it
takes a JavaLibrary and dexes the output of the JavaLibrary if its list of
classes is non-empty. Because it is expected to be used with pre-dexing, we always pass the
--force-jumbo flag to dx in this buildable.
Most BuildRules can determine the (possibly null) path to their output file from their
definition. This is an anomaly because we do not know whether this will write a .dex file
until runtime. Unfortunately, because there is no such thing as an empty .dex file, we
cannot write a meaningful "dummy .dex" if there are no class files to pass to dx.
| Constructor and Description |
|---|
DexProducedFromJavaLibrary(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
SourcePathRuleFinder ruleFinder,
AndroidPlatformTarget androidPlatformTarget,
JavaLibrary javaLibrary) |
DexProducedFromJavaLibrary(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
SourcePathRuleFinder ruleFinder,
AndroidPlatformTarget androidPlatformTarget,
JavaLibrary javaLibrary,
String dexTool,
int weightFactor,
com.google.common.collect.ImmutableSortedSet<BuildRule> desugarDeps) |
| Modifier and Type | Method and Description |
|---|---|
BuildOutputInitializer<com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput> |
getBuildOutputInitializer() |
com.google.common.collect.ImmutableSortedSet<SourcePath> |
getDesugarDeps() |
BuildTarget |
getJavaLibraryBuildTarget() |
OutputPath |
getPathToDex() |
com.google.common.collect.ImmutableList<String> |
getReferencedResources() |
SourcePath |
getSourcePathToOutput() |
boolean |
hasOutput() |
com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput |
initializeFromDisk(SourcePathResolverAdapter pathResolver) |
compareTo, getBuildable, getBuildCellPathFactory, getBuildDeps, getBuildSteps, getOutputPathResolver, getSetupStepsForBuildable, getSourcePath, getSourcePaths, injectFieldsIfNecessary, inputBasedRuleKeyIsEnabled, recordOutputs, recordOutputs, recordOutputs, stepsForBuildable, stepsForBuildable, updateBuildRuleResolverequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitinvalidateInitializeFromDiskStatecompareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsgetTypeisSupportedpublic DexProducedFromJavaLibrary(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, SourcePathRuleFinder ruleFinder, AndroidPlatformTarget androidPlatformTarget, JavaLibrary javaLibrary, String dexTool, int weightFactor, com.google.common.collect.ImmutableSortedSet<BuildRule> desugarDeps)
public DexProducedFromJavaLibrary(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, SourcePathRuleFinder ruleFinder, AndroidPlatformTarget androidPlatformTarget, JavaLibrary javaLibrary)
public com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput initializeFromDisk(SourcePathResolverAdapter pathResolver) throws IOException
initializeFromDisk in interface InitializableFromDisk<com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput>IOExceptionpublic BuildOutputInitializer<com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput> getBuildOutputInitializer()
getBuildOutputInitializer in interface InitializableFromDisk<com.facebook.buck.android.DexProducedFromJavaLibrary.BuildOutput>@Nullable public SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulegetSourcePathToOutput in class ModernBuildRule<com.facebook.buck.android.DexProducedFromJavaLibrary.Impl>public com.google.common.collect.ImmutableSortedSet<SourcePath> getDesugarDeps()
public OutputPath getPathToDex()
public boolean hasOutput()
public com.google.common.collect.ImmutableList<String> getReferencedResources()
public BuildTarget getJavaLibraryBuildTarget()