From 9ec73b26ee8a65f735f085327d841764b5dd43d1 Mon Sep 17 00:00:00 2001
From: Mattias Reichel <mattias.reichel@gmail.com>
Date: Tue, 14 Jan 2025 07:37:28 +0100
Subject: [PATCH] build: use Groovy version from the BOM for groovydoc
 generation

---
 gradle/documentation-config.gradle | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gradle/documentation-config.gradle b/gradle/documentation-config.gradle
index edff04cb9f..ae583c4ea2 100644
--- a/gradle/documentation-config.gradle
+++ b/gradle/documentation-config.gradle
@@ -1,8 +1,11 @@
+apply plugin: 'groovy'
+
 configurations.register('documentation')
 
 dependencies {
-    documentation "org.apache.groovy:groovy-groovydoc:4.0.24"
-    documentation "org.apache.groovy:groovy-ant:4.0.24"
+    documentation platform("org.grails:grails-bom:$grailsVersion")
+    documentation 'org.apache.groovy:groovy-groovydoc'
+    documentation 'org.apache.groovy:groovy-ant'
 }
 
 tasks.register('cleanDocs', Delete) {
@@ -10,7 +13,7 @@ tasks.register('cleanDocs', Delete) {
     delete(rootProject.layout.buildDirectory.dir('docs'))
 }
 
-tasks.register('groovydoc', Groovydoc) {
+tasks.withType(Groovydoc).configureEach {
     group = 'documentation'
     description = 'Copies Groovy API Documentation for all supporting projects'
     Set<Project> groovyDocProjects = rootProject.subprojects.findAll {