java.lang.Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, org.gradle.api.internal.tasks.compile.HasCompileOptions, ExtensionAware, Task, PatternFilterable, Configurable<Task>@CacheableTask public class JavaCompile extends AbstractCompile implements org.gradle.api.internal.tasks.compile.HasCompileOptions
plugins {
id 'java'
}
tasks.withType(JavaCompile) {
//enable compilation in a separate daemon process
options.fork = true
}
Task.NamerTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor | Description |
|---|---|
JavaCompile() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
compile(InputChanges inputs) |
Compile the sources, taking into account the changes reported by inputs.
|
FileCollection |
getClasspath() |
Returns the classpath to use to compile the source files.
|
protected org.gradle.internal.file.Deleter |
getDeleter() |
|
protected org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory |
getIncrementalCompilerFactory() |
|
Property<JavaCompiler> |
getJavaCompiler() |
Configures the java compiler to be used to compile the Java source.
|
protected org.gradle.internal.jvm.JavaModuleDetector |
getJavaModuleDetector() |
|
protected JavaToolchainService |
getJavaToolchainService() |
|
ModularitySpec |
getModularity() |
Returns the module path handling of this compile task.
|
CompileOptions |
getOptions() |
Returns the compilation options.
|
protected java.io.File |
getPreviousCompilationData() |
The previous compilation analysis.
|
protected ProjectLayout |
getProjectLayout() |
|
FileTree |
getSource() |
Returns the source for this task, after the include and exclude patterns have been applied.
|
protected FileCollection |
getStableSources() |
The sources for incremental change detection.
|
getDestinationDir, getDestinationDirectory, getSourceCompatibility, getTargetCompatibility, setClasspath, setDestinationDir, setDestinationDir, setSourceCompatibility, setTargetCompatibilityexclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSet, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceconventionMapping, conventionMapping, getConventionMappingcompareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceappendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoNotTrackState, getConvention, notCompatibleWithConfigurationCache@Internal("tracked via stableSources") public FileTree getSource()
The PathSensitivity for the sources is configured to be PathSensitivity.ABSOLUTE.
If your sources are less strict, please change it accordingly by overriding this method in your subclass.
getSource in class SourceTask@Optional public Property<JavaCompiler> getJavaCompiler()
JavaToolchainSpecprotected void compile(InputChanges inputs)
@Inject protected org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory getIncrementalCompilerFactory()
@Inject protected org.gradle.internal.jvm.JavaModuleDetector getJavaModuleDetector()
@Inject protected org.gradle.internal.file.Deleter getDeleter()
@Inject protected ProjectLayout getProjectLayout()
@Inject protected JavaToolchainService getJavaToolchainService()
@OutputFile protected java.io.File getPreviousCompilationData()
public ModularitySpec getModularity()
public CompileOptions getOptions()
getOptions in interface org.gradle.api.internal.tasks.compile.HasCompileOptions@CompileClasspath @Incremental public FileCollection getClasspath()
AbstractCompilegetClasspath in class AbstractCompile@SkipWhenEmpty @IgnoreEmptyDirectories @NormalizeLineEndings @PathSensitive(RELATIVE) @InputFiles protected FileCollection getStableSources()