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

   ## Summary
   
   Extracts the duplicated AntBuilder groovydoc configuration (introduced in PR 
#15420) into a reusable `GrailsGroovydocPlugin` convention plugin in 
`build-logic/`, eliminating ~490 lines of duplicated build logic across 8 
scripts.
   
   **Depends on**: PR #15420 (`fix/groovydoc-java-version`)
   
   ## Changes
   
   ### New files in `build-logic/`
   - **`GrailsGroovydocPlugin`** - Convention plugin 
(`org.apache.grails.buildsrc.groovydoc`) that:
     - Replaces Gradle's built-in Groovydoc execution with AntBuilder for 
`javaVersion` support
     - Adds the Matomo analytics footer to all generated docs
     - Resolves source directories from the `main` source set
     - Supports external doc links via `ext.groovydocLinks`
     - Handles the `GroovydocAccess` enum via `Class.forName` (not on 
build-logic compile classpath)
     - Handles Gradle's mixed `Property<T>` / plain-value API via 
`resolveGroovydocProperty()`
   - **`GrailsGroovydocExtension`** - Configurable extension with:
     - `javaVersion` (default: `JAVA_17`) - target Java version for Groovydoc 
output
     - `javaVersionEnabled` (default: `true`) - allows disabling for Groovy 3.x 
(Forge uses 3.0.25 which lacks `javaVersion` support)
   
   ### Simplified build scripts
   | Script | Before | After |
   |--------|--------|-------|
   | `gradle/docs-dependencies.gradle` | Full AntBuilder config + deps | Plugin 
apply + deps + dynamic links |
   | `gradle/docs-config.gradle` | AntBuilder config + includeInApiDocs | 
Plugin apply + includeInApiDocs |
   | `grails-gradle/gradle/docs-config.gradle` | Full AntBuilder config + deps 
| Plugin apply + deps + custom dest dir |
   | `grails-forge/gradle/doc-config.gradle` | Full AntBuilder config + deps | 
Plugin apply (`javaVersionEnabled = false`) + deps |
   | `grails-data-hibernate5/docs/build.gradle` | Full AntBuilder config + deps 
| Plugin apply + deps + custom source collection |
   | `grails-data-mongodb/docs/build.gradle` | Full AntBuilder config + deps | 
Plugin apply + deps + custom source collection |
   | `grails-doc/build.gradle` | Duplicated Matomo footer in aggregate task | 
Footer from plugin |
   | `grails-data-docs/stage/build.gradle` | Duplicated Matomo footer in 
aggregate task | Footer from plugin |
   
   ## Stats
   
   - 11 files changed, 275 insertions, 491 deletions (net **-216 lines**)
   
   ## Testing
   
   - [x] Per-module groovydoc generation (grails-core)
   - [x] grails-gradle groovydoc generation
   - [x] Aggregate groovydoc (3,929 HTML files generated)
   - [x] Data mapping aggregate groovydoc
   - [x] `./gradlew codeStyle` passes
   - [x] Forge groovydoc (with `javaVersionEnabled = false`)
   
   Resolves #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