# getConfigurationScript

@Optional
@PathSensitive(value = PathSensitivity.NONE)
@InputFile
abstract fun getConfigurationScript(): RegularFileProperty(source)

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:

- The instance of CompilerConfiguration available as the `configuration` variable.
- All static members of CompilerCustomizationBuilder pre imported.

This facilitates the following pattern:

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

Content copied to clipboard

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

    import groovy.transform.TypeChecked

    withConfig(configuration) {
        ast(TypeChecked)
    }

Content copied to clipboard

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

CompilerCustomizationBuilder