# CompileOptions

abstract class CompileOptions : Serializable(source)

Main options for Java compilation.

## Constructors

CompileOptions
Link copied to clipboard
@Inject
constructor(objectFactory: ObjectFactory)

## Properties

annotationProcessorPath
Link copied to clipboard
@get:Nullable
@get:Optional
@get:Classpath
open var annotationProcessorPath: FileCollection
bootstrapClasspath
Link copied to clipboard
@get:Nullable
@get:Optional
@get:CompileClasspath
open var bootstrapClasspath: FileCollection
compilerArgs
Link copied to clipboard
@get:Input
open var compilerArgs: List<String>
compilerArgumentProviders
Link copied to clipboard
val compilerArgumentProviders: List<CommandLineArgumentProvider>
encoding
Link copied to clipboard
@get:Nullable
@get:Optional
@get:Input
open var encoding: String
extensionDirs
Link copied to clipboard
@get:Nullable
@get:Optional
@get:Input
open var extensionDirs: String
sourcepath
Link copied to clipboard
@get:Optional
@get:Nullable
@get:IgnoreEmptyDirectories
@get:PathSensitive(value = PathSensitivity.RELATIVE)
@get:InputFiles
open var sourcepath: FileCollection

## Functions

debugOptions
Link copied to clipboard
open fun debugOptions(action: Action<in DebugOptions>)
Execute the given action against getDebugOptions.
forkOptions
Link copied to clipboard
open fun forkOptions(action: Action<in ForkOptions>)
Execute the given action against getForkOptions.
getAllCompilerArgs
Link copied to clipboard
@Internal
open fun getAllCompilerArgs(): List<String>
Returns all compiler arguments, added to the getCompilerArgs or the getCompilerArgumentProviders property.
getDebugOptions
Link copied to clipboard
abstract fun getDebugOptions(): DebugOptions
Returns options for generating debugging information.
getForkOptions
Link copied to clipboard
abstract fun getForkOptions(): ForkOptions
Returns options for running the compiler in a child process.
getGeneratedSourceOutputDirectory
Link copied to clipboard
@Optional
@OutputDirectory
abstract fun getGeneratedSourceOutputDirectory(): DirectoryProperty
Returns the directory to place source files generated by annotation processors.
getHeaderOutputDirectory
Link copied to clipboard
@Optional
@OutputDirectory
abstract fun getHeaderOutputDirectory(): DirectoryProperty
If this option is set to a non-null directory, it will be passed to the Java compiler's `-h` option, prompting it to generate native headers to that directory.
getIncrementalAfterFailure
Link copied to clipboard
@Input
@Optional
@Incubating
abstract fun getIncrementalAfterFailure(): Property<Boolean>
Used to enable or disable incremental compilation after a failure.
getJavaModuleMainClass
Link copied to clipboard
@Optional
@Input
abstract fun getJavaModuleMainClass(): Property<String>
Set the main class of the Java module, if the module is supposed to be executable.
getJavaModuleVersion
Link copied to clipboard
@Optional
@Input
abstract fun getJavaModuleVersion(): Property<String>
Set the version of the Java module.
getRelease
Link copied to clipboard
@Input
@Optional
abstract fun getRelease(): Property<Integer>
Configures the Java language version for this compile task (`--release` compiler flag).
isDebug
Link copied to clipboard
@Input
open fun isDebug(): Boolean
Tells whether to include debugging information in the generated class files.
isDeprecation
Link copied to clipboard
@Console
open fun isDeprecation(): Boolean
Tells whether to log details of usage of deprecated members or classes.
isFailOnError
Link copied to clipboard
@Input
open fun isFailOnError(): Boolean
Tells whether to fail the build when compilation fails.
isFork
Link copied to clipboard
@Input
open fun isFork(): Boolean
Tells whether to run the compiler in its own process.
isIncremental
Link copied to clipboard
@Internal
open fun isIncremental(): Boolean
informs whether to use incremental compilation feature.
isListFiles
Link copied to clipboard
@Console
open fun isListFiles(): Boolean
Tells whether to log the files to be compiled.
isVerbose
Link copied to clipboard
@Console
open fun isVerbose(): Boolean
Tells whether to produce verbose output.
isWarnings
Link copied to clipboard
@Console
open fun isWarnings(): Boolean
Tells whether to log warning messages.
setDebug
Link copied to clipboard
open fun setDebug(debug: Boolean)
Sets whether to include debugging information in the generated class files.
setDeprecation
Link copied to clipboard
open fun setDeprecation(deprecation: Boolean)
Sets whether to log details of usage of deprecated members or classes.
setFailOnError
Link copied to clipboard
open fun setFailOnError(failOnError: Boolean)
Sets whether to fail the build when compilation fails.
setFork
Link copied to clipboard
open fun setFork(fork: Boolean)
Sets whether to run the compiler in its own process.
setIncremental
Link copied to clipboard
open fun setIncremental(incremental: Boolean): CompileOptions
Configure the java compilation to be incremental (e.g.
setListFiles
Link copied to clipboard
open fun setListFiles(listFiles: Boolean)
Sets whether to log the files to be compiled.
setVerbose
Link copied to clipboard
open fun setVerbose(verbose: Boolean)
Sets whether to produce verbose output.
setWarnings
Link copied to clipboard
open fun setWarnings(warnings: Boolean)
Sets whether to log warning messages.