@CompileStatic @org.gradle.work.DisableCachingByDefault(because: Writing a short script from a string is cheaper than a cache round trip) abstract class GrailsCompilerConfigScriptTask extends DefaultTask
Writes the Groovy compiler configuration script a org.gradle.api.tasks.compile.GroovyCompile task compiles with.
The script cannot be assigned from a task action: Gradle finalizes task properties before any
action runs, so from Gradle 9.7 on — where GroovyCompileOptions became a lazy property —
assigning groovyOptions.configurationScript at execution time fails. Assigning it during
configuration then makes it an input file that must exist before compilation starts, which is what
this task guarantees.
The Grails half of the script is a plain Input, built entirely from configuration state, so this task is up-to-date checked like any other rather than opting out of state tracking. The build's own script, when it has one, is an InputFile: Gradle then fails the build when the file is missing, the way it would have for the compile task itself.
| Constructor and description |
|---|
GrailsCompilerConfigScriptTask() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
abstract RegularFileProperty |
getConfigurationScript()The configurationScript the build configured on the compile task, if any. |
|
abstract Property<java.lang.String> |
getGrailsScript()The Grails compiler configuration: the star imports, and for a plugin the metadata it stamps on compiled classes. |
|
abstract RegularFileProperty |
getOutputFile() |
|
void |
writeScript() |
The configurationScript the build configured on the compile task, if any. Its
content follows the Grails configuration in the combined script.
The Grails compiler configuration: the star imports, and for a plugin the metadata it stamps on compiled classes. Absent when there is nothing to add.