api / org.gradle.api.tasks.compile / AbstractCompile

AbstractCompile

abstract class AbstractCompile : SourceTask

The base class for all JVM-based language compilation tasks.

Constructors

<init>

AbstractCompile()

Functions

getClasspath

open fun getClasspath(): FileCollection

Returns the classpath to use to compile the source files.

getDestinationDir

open fun getDestinationDir(): File

Returns the directory to generate the .class files into.

getSourceCompatibility

open fun getSourceCompatibility(): String

Returns the Java language level to use to compile the source files.

getTargetCompatibility

open fun getTargetCompatibility(): String

Returns the target JVM to generate the .class files for.

setClasspath

open fun setClasspath(configuration: FileCollection): Unit

Sets the classpath to use to compile the source files.

setDestinationDir

open fun setDestinationDir(destinationDir: File): Unit
open fun setDestinationDir(destinationDir: Provider<File>): Unit

Sets the directory to generate the .class files into.

setSourceCompatibility

open fun setSourceCompatibility(sourceCompatibility: String): Unit

Sets the Java language level to use to compile the source files.

setTargetCompatibility

open fun setTargetCompatibility(targetCompatibility: String): Unit

Sets the target JVM to generate the .class files for.

Inherited Functions

exclude

open fun exclude(vararg excludes: String): SourceTask
open fun exclude(excludes: MutableIterable<String>): SourceTask
open fun exclude(excludeSpec: Spec<FileTreeElement>): SourceTask
open fun exclude(excludeSpec: Closure<Any>): SourceTask

{@inheritDoc}

getExcludes

open fun getExcludes(): MutableSet<String>

{@inheritDoc}

getIncludes

open fun getIncludes(): MutableSet<String>

{@inheritDoc}

getSource

open fun getSource(): FileTree

Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

include

open fun include(vararg includes: String): SourceTask
open fun include(includes: MutableIterable<String>): SourceTask
open fun include(includeSpec: Spec<FileTreeElement>): SourceTask
open fun include(includeSpec: Closure<Any>): SourceTask

{@inheritDoc}

setExcludes

open fun setExcludes(excludes: MutableIterable<String>): SourceTask

{@inheritDoc}

setIncludes

open fun setIncludes(includes: MutableIterable<String>): SourceTask

{@inheritDoc}

setSource

open fun setSource(source: FileTree): Unit

Sets the source for this task.

open fun setSource(source: Any): Unit

Sets the source for this task. The given source object is evaluated as per org.gradle.api.Project#files(Object...).

source

open fun source(vararg sources: Any): SourceTask

Adds some source to this task. The given source objects will be evaluated as per org.gradle.api.Project#files(Object...).

Inheritors

AbstractScalaCompile

abstract class AbstractScalaCompile : AbstractCompile

An abstract Scala compile task sharing common functionality for compiling scala.

GroovyCompile

open class GroovyCompile : AbstractCompile

Compiles Groovy source files, and optionally, Java source files.

JavaCompile

open class JavaCompile : AbstractCompile

Compiles Java source files.

 apply plugin: 'java' tasks.withType(JavaCompile) { //enable compilation in a separate daemon process options.fork = true //enable incremental compilation options.incremental = true }