codeconsole commented on PR #16114:
URL: https://github.com/apache/grails-core/pull/16114#issuecomment-5504350477
Both confirmed and fixed in 818d22b56f, each with a regression case in
`GrailsGroovyCompilerConfigSpec` that fails against the previous head.
**Standalone `GroovyCompile`.** The generator is now created on demand: the
compile task's `dependsOn` resolves to `groovyCompilerConfigGenerator(project,
name)`, which registers the task if no source set already did. That resolution
happens while the task graph is built — after configuration, when the task
container is mutable again — so it is not a registration from inside a task
configuration action, which is what throws. The source-set hook stays, so the
usual generators are still listed and a late source set is still covered. The
`whenReady` capture now walks `graph.allTasks` instead of every `GroovyCompile`
name in the project: only the tasks about to run are taken over, and nothing is
realized just to be looked at.
Test: *a GroovyCompile that no source set owns is wired like the source set
ones* — a directly registered `compileCustomGroovy` with a
`configurationScript` of its own compiles with the combined script, carrying
both the Grails imports and its own. The same fixture then runs twice with
`--configuration-cache`, so the on-demand generator is shown to be part of the
cached graph.
**Missing user script.** The build's script is now an `@InputFile @Optional`
of the generator rather than text folded into the `@Input` string, so Gradle's
own validation fails the build before the generator runs:
```
A problem was found with the configuration of task
':generateCompileGroovyGrailsCompilerConfig' (type
'GrailsCompilerConfigScriptTask').
Input file does not exist
... property 'configurationScript' specifies file
'.../missing-config.groovy' which doesn't exist
```
Producer support is unchanged: the ordering edge to the task that writes the
script is still declared, and the classpath decoupling assertions still hold
(`GENERATOR_DECLARED_INPUT_FILES=0` when no script is configured).
Test: *a configurationScript that does not exist fails the build instead of
being dropped*.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]