api / org.gradle.api.tasks.compile / GroovyCompileOptions / getConfigurationScript

getConfigurationScript

@Optional @PathSensitive(PathSensitivity.NONE) @InputFile open fun getConfigurationScript(): File

A Groovy script file that configures the compiler, allowing extensive control over how the code is compiled.

The script is executed as Groovy code, with the following context:

This facilitates the following pattern:

 withConfig(configuration) { // use compiler configuration DSL here } 

For example, to activate type checking for all Groovy classes…

 import groovy.transform.TypeChecked withConfig(configuration) { ast(TypeChecked) } 

Please see the Groovy compiler customization builder documentation for more information about the compiler configuration DSL.

This feature is only available if compiling with Groovy 2.1 or later.

See Also
<a href="http://docs.groovy-lang.org/latest/html/gapi/org/codehaus/groovy/control/CompilerConfiguration.html">CompilerConfiguration</a><a href="http://docs.groovy-lang.org/latest/html/gapi/org/codehaus/groovy/control/customizers/builder/CompilerCustomizationBuilder.html">CompilerCustomizationBuilder</a>