# CompileOptions

abstract class CompileOptions : Serializable(source)

Main options for Java compilation.

## Constructors

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

## 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(): Provider<List<String>>
Returns all compiler arguments, added to the getCompilerArgs or the getCompilerArgumentProviders property.
getAnnotationProcessorPath
Link copied to clipboard
@Optional
@Classpath
abstract fun getAnnotationProcessorPath(): ConfigurableFileCollection
Returns the classpath to use to load annotation processors.
getBootstrapClasspath
Link copied to clipboard
@Optional
@CompileClasspath
abstract fun getBootstrapClasspath(): ConfigurableFileCollection
Returns the bootstrap classpath to be used for the compiler process.
getCompilerArgs
Link copied to clipboard
@Input
abstract fun getCompilerArgs(): ListProperty<String>
Returns any additional arguments to be passed to the compiler.
getCompilerArgumentProviders
Link copied to clipboard
abstract fun getCompilerArgumentProviders(): ListProperty<CommandLineArgumentProvider>
Compiler argument providers.
getDebug
Link copied to clipboard
@Input
abstract fun getDebug(): Property<Boolean>
Tells whether to include debugging information in the generated class files.
getDebugOptions
Link copied to clipboard
abstract fun getDebugOptions(): DebugOptions
Returns options for generating debugging information.
getDeprecation
Link copied to clipboard
@Console
abstract fun getDeprecation(): Property<Boolean>
Tells whether to log details of usage of deprecated members or classes.
getEncoding
Link copied to clipboard
@Optional
@Input
abstract fun getEncoding(): Property<String>
Returns the character encoding to be used when reading source files.
getExtensionDirs
Link copied to clipboard
@Optional
@Input
abstract fun getExtensionDirs(): Property<String>
Returns the extension dirs to be used for the compiler process.
getFailOnError
Link copied to clipboard
@Input
abstract fun getFailOnError(): Property<Boolean>
Sets whether to fail the build when compilation fails.
getFork
Link copied to clipboard
@Input
abstract fun getFork(): Property<Boolean>
Tells whether to run the compiler in its own process.
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.
getIncremental
Link copied to clipboard
@Internal
abstract fun getIncremental(): Property<Boolean>
informs whether to use incremental compilation feature.
getIncrementalAfterFailure
Link copied to clipboard
@Input
@Optional
abstract fun getIncrementalAfterFailure(): Property<Boolean>
Used to enable or disable incremental compilation after a failure.
getIsDebug
Link copied to clipboard
@ReplacedBy(value = "debug")
open fun getIsDebug(): Property<Boolean>
Sets whether to include debugging information in the generated class files.
getIsDeprecation
Link copied to clipboard
@ReplacedBy(value = "deprecation")
open fun getIsDeprecation(): Property<Boolean>
Sets whether to log details of usage of deprecated members or classes.
getIsFailOnError
Link copied to clipboard
@ReplacedBy(value = "failOnError")
open fun getIsFailOnError(): Property<Boolean>
getIsFork
Link copied to clipboard
@ReplacedBy(value = "fork")
open fun getIsFork(): Property<Boolean>
Sets whether to run the compiler in its own process.
getIsIncremental
Link copied to clipboard
@ReplacedBy(value = "incremental")
open fun getIsIncremental(): Property<Boolean>
getIsListFiles
Link copied to clipboard
@ReplacedBy(value = "listFiles")
open fun getIsListFiles(): Property<Boolean>
getIsVerbose
Link copied to clipboard
@ReplacedBy(value = "verbose")
open fun getIsVerbose(): Property<Boolean>
getIsWarnings
Link copied to clipboard
@ReplacedBy(value = "warnings")
open fun getIsWarnings(): Property<Boolean>
Sets whether to log warning messages.
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.
getListFiles
Link copied to clipboard
@Console
abstract fun getListFiles(): Property<Boolean>
Tells whether to log the files to be compiled.
getRelease
Link copied to clipboard
@Input
@Optional
abstract fun getRelease(): Property<Integer>
Configures the Java language version for this compile task (`--release` compiler flag).
getSourcepath
Link copied to clipboard
@Optional
@IgnoreEmptyDirectories
@PathSensitive(value = PathSensitivity.RELATIVE)
@InputFiles
abstract fun getSourcepath(): ConfigurableFileCollection
The source path to use for the compilation.
getVerbose
Link copied to clipboard
@Console
abstract fun getVerbose(): Property<Boolean>
Tells whether to produce verbose output.
getWarnings
Link copied to clipboard
@Console
abstract fun getWarnings(): Property<Boolean>
Tells whether to log warning messages.