public class JavaBinary extends AbstractBuildRuleWithDeclaredAndExtraDeps implements BinaryBuildRule, HasClasspathDeps, HasClasspathEntries, HasRuntimeDeps
Constructor and Description |
---|
JavaBinary(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams params,
Tool javaRuntimeLauncher,
String mainClass,
SourcePath manifestFile,
boolean mergeManifests,
boolean disallowAllDuplicates,
Path metaInfDirectory,
com.google.common.collect.ImmutableSet<Pattern> blacklist,
com.google.common.collect.ImmutableSet<JavaLibrary> transitiveClasspathDeps,
com.google.common.collect.ImmutableSet<SourcePath> transitiveClasspaths,
boolean cache,
Level duplicatesLogLevel) |
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
Set<BuildRule> |
getDepsForTransitiveClasspathEntries() |
Tool |
getExecutableCommand(OutputLabel outputLabel)
Command to execute the output of this rule.
|
com.google.common.collect.ImmutableSet<SourcePath> |
getImmediateClasspaths()
Returns the classpaths for only this rule, not its deps.
|
com.google.common.collect.ImmutableSet<SourcePath> |
getOutputClasspaths() |
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToOutput() |
com.google.common.collect.ImmutableSet<JavaLibrary> |
getTransitiveClasspathDeps() |
com.google.common.collect.ImmutableSet<SourcePath> |
getTransitiveClasspaths() |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDeps
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
public JavaBinary(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params, Tool javaRuntimeLauncher, @Nullable String mainClass, @Nullable SourcePath manifestFile, boolean mergeManifests, boolean disallowAllDuplicates, @Nullable Path metaInfDirectory, com.google.common.collect.ImmutableSet<Pattern> blacklist, com.google.common.collect.ImmutableSet<JavaLibrary> transitiveClasspathDeps, com.google.common.collect.ImmutableSet<SourcePath> transitiveClasspaths, boolean cache, Level duplicatesLogLevel)
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
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 SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public Tool getExecutableCommand(OutputLabel outputLabel)
BinaryBuildRule
getExecutableCommand
in interface BinaryBuildRule
outputLabel
- associated with the executablepublic boolean isCacheable()
BuildRule
BuildRule
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.
isCacheable
in interface BuildEngineAction
isCacheable
in interface BuildRule
isCacheable
in class AbstractBuildRule
public Set<BuildRule> getDepsForTransitiveClasspathEntries()
getDepsForTransitiveClasspathEntries
in interface HasClasspathDeps
public java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps
in interface HasRuntimeDeps