API Documentation: | GroovyCompileOptions |
---|
Compilation options to be passed to the Groovy compiler.
Property | Description |
encoding | Tells the source encoding. Defaults to |
failOnError | Tells whether the compilation task should fail if compile errors occurred. Defaults to |
fileExtensions | Incubating The list of acceptable source file extensions. Only takes effect when compiling against
Groovy 1.7 or higher. Defaults to |
fork | Tells whether to run the Groovy compiler in a separate process. Defaults to |
forkOptions | Returns options for running the Groovy compiler in a separate process. These options only take effect
if |
includeJavaRuntime | Deprecated Tells whether the Java runtime should be put on the compile class path. Only takes effect if
|
keepStubs | Tells whether Java stubs for Groovy classes generated during Java/Groovy joint compilation
should be kept after compilation has completed. Useful for joint compilation debugging purposes.
Defaults to |
listFiles | Tells whether to print which source files are to be compiled. Defaults to |
optimizationOptions | Returns optimization options for the Groovy compiler. Allowed values for an option are |
stacktrace | Deprecated Tells whether to print a stack trace when the compiler hits a problem (like a compile error).
Defaults to |
stubDir | The directory where Java stubs for Groovy classes will be stored during Java/Groovy joint
compilation. Defaults to |
useAnt | Deprecated Tells whether the groovyc Ant task should be used over Gradle's own Groovy compiler integration.
Defaults to |
verbose | Tells whether to turn on verbose output. Defaults to |
Tells whether the compilation task should fail if compile errors occurred. Defaults to true
.
- Default:
true
Note: This property is incubating and may change in a future version of Gradle.
The list of acceptable source file extensions. Only takes effect when compiling against
Groovy 1.7 or higher. Defaults to ImmutableList.of("java", "groovy")
.
- Default:
["java", "groovy"]
Tells whether to run the Groovy compiler in a separate process. Defaults to true
.
- Default:
true
GroovyForkOptions
forkOptions
Returns options for running the Groovy compiler in a separate process. These options only take effect
if fork
is set to true
.
Note: This property is deprecated and will be removed in the next major version of Gradle.
Tells whether the Java runtime should be put on the compile class path. Only takes effect if
useAnt
is true
. Defaults to false
.
- Default:
false
Tells whether Java stubs for Groovy classes generated during Java/Groovy joint compilation
should be kept after compilation has completed. Useful for joint compilation debugging purposes.
Defaults to false
.
- Default:
false
Tells whether to print which source files are to be compiled. Defaults to false
.
- Default:
false
Returns optimization options for the Groovy compiler. Allowed values for an option are true
and false
.
Only takes effect when compiling against Groovy 1.8 or higher.
Known options are:
- indy
- Use the invokedynamic bytecode instruction. Requires JDK7 or higher and Groovy 2.0 or higher. Disabled by default.
- int
- Optimize operations on primitive types (e.g. integers). Enabled by default.
- all
- Enable or disable all optimizations. Note that some optimizations might be mutually exclusive.
- Default:
[:]
Note: This property is deprecated and will be removed in the next major version of Gradle.
Tells whether to print a stack trace when the compiler hits a problem (like a compile error).
Defaults to false
. Only used when GroovyCompileOptions.isUseAnt()
is true
.
- Default:
false
File
stubDir
The directory where Java stubs for Groovy classes will be stored during Java/Groovy joint
compilation. Defaults to null
, in which case a temporary directory will be used.
- Default:
null
Note: This property is deprecated and will be removed in the next major version of Gradle.
Tells whether the groovyc Ant task should be used over Gradle's own Groovy compiler integration.
Defaults to false
.
- Default:
false
Method | Description |
fork(forkArgs) | Convenience method to set |
GroovyCompileOptions
fork
(Map
forkArgs)
Convenience method to set GroovyForkOptions
with named parameter syntax.
Calling this method will set fork
to true
.