jamesfredley opened a new pull request, #15420:
URL: https://github.com/apache/grails-core/pull/15420

   ## Summary
   
   Replaces Gradle built-in Groovydoc task execution with direct AntBuilder 
invocation of the Groovy `org.codehaus.groovy.ant.Groovydoc` Ant task, enabling 
the `javaVersion` parameter introduced in Groovy 4.0.27 (GROOVY-11668).
   
   ## Problem
   
   Gradle `Groovydoc` task does not expose the `javaVersion` property 
(gradle/gradle#33659 is not merged). Without it, groovydoc defaults to 
`JAVA_11` language level when parsing Java source files, causing failures when 
processing Java 17+ features like sealed classes, records, and pattern matching.
   
   ## Solution
   
   For each Groovydoc task:
   1. Clear Gradle built-in `@TaskAction` execution
   2. Replace with a `doLast` that uses AntBuilder to call 
`org.codehaus.groovy.ant.Groovydoc` directly
   3. Pass `javaVersion: JAVA_17` (derived from `gradle.properties`) to enable 
correct Java 17+ source parsing
   
   ### Files changed
   
   | File | Scope | Notes |
   |------|-------|-------|
   | `gradle/docs-dependencies.gradle` | Central config (~90 modules + 2 
aggregate tasks) | Main AntBuilder execution with `javaVersion`, dynamic link 
resolution |
   | `gradle/docs-config.gradle` | Per-module source directory setup | Sets 
`groovydocSourceDirs` from project source sets |
   | `grails-doc/build.gradle` | `aggregateGroovydoc` task | Sets source 
directories for aggregate across all subprojects |
   | `grails-data-docs/stage/build.gradle` | `aggregateDataMappingGroovydoc` 
task | Sets source directories for data mapping aggregate |
   | `grails-gradle/gradle/docs-config.gradle` | grails-gradle independent 
config | Own AntBuilder setup with `javaVersion` |
   | `grails-data-hibernate5/docs/build.gradle` | Hibernate5 docs | Added 
`groovy-ant`/`groovy-groovydoc` deps + AntBuilder |
   | `grails-data-mongodb/docs/build.gradle` | MongoDB docs | Added 
`groovy-ant`/`groovy-groovydoc` deps + AntBuilder |
   | `grails-forge/gradle/doc-config.gradle` | Forge (Groovy 3.0.25) | 
AntBuilder **without** `javaVersion` (not available in Groovy 3.x) |
   
   ### Technical details
   
   - A `resolveGroovydocProperty()` helper handles the mix of plain values and 
`Property<T>` wrappers in Gradle `Groovydoc` task API
   - Source directories are passed via `ext.groovydocSourceDirs` for aggregate 
tasks, or derived from source sets for per-module tasks
   - The `documentation` configuration already includes `groovy-ant` in the 
central config; hibernate5 and mongodb docs needed it added
   - Disabled groovydoc tasks (test suites) are unaffected - Gradle checks 
`enabled` before running any actions
   - The `grails-data-neo4j` and `grails-data-graphql` modules are not in the 
build and were not changed
   
   ## Testing
   
   - [x] Per-module groovydoc: `:grails-core:groovydoc`, 
`:grails-bootstrap:groovydoc`
   - [x] grails-gradle module: `:grails-gradle-plugins:groovydoc`
   - [x] Aggregate groovydoc: `:grails-doc:aggregateGroovydoc` (3,927 HTML 
files generated)
   - [x] Data mapping aggregate: 
`:grails-data-docs-stage:aggregateDataMappingGroovydoc`
   - [x] Code style check: `./gradlew codeStyle` passes
   
   Closes #15385


-- 
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]

Reply via email to