jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3137475534


##########
grails-forge/grails-forge-api/build.gradle:
##########
@@ -57,22 +58,23 @@ dependencies {
     testImplementation 'io.micronaut:micronaut-http-client'
     testImplementation 'io.micronaut:micronaut-http-server-netty'
     testImplementation 'io.micronaut.test:micronaut-test-spock'
+    testRuntimeOnly 'io.micronaut:micronaut-jackson-databind'
 
     testCompileOnly "io.micronaut:micronaut-inject-groovy:$micronautVersion"

Review Comment:
   Fixed in the latest commit. `grails-forge-api/build.gradle` already imports 
`io.micronaut.platform:micronaut-platform` as a platform, so `testCompileOnly 
'io.micronaut:micronaut-inject-groovy'` is now unversioned and the duplicated 
`if (project.hasProperty('micronautVersion')) { ... }` block (which was a no-op 
copy of the line above) has been removed. Resolving.



##########
grails-forge/grails-forge-cli/build.gradle:
##########
@@ -68,10 +68,10 @@ ext {
 }
 
 dependencies {
-    annotationProcessor 
platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor 
platform("io.micronaut.platform:micronaut-platform:$micronautVersion")
+    implementation 
platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Fixed in the latest commit. `grails-forge-cli/build.gradle` already imports 
`io.micronaut.platform:micronaut-platform` as a platform, so the 
`testCompileOnly 'io.micronaut:micronaut-inject-groovy'` reference is now 
unversioned and the redundant `if (project.hasProperty('micronautVersion')) { 
... }` guard has been dropped. Resolving.



##########
grails-forge/grails-forge-core/build.gradle:
##########
@@ -41,13 +41,15 @@ sourceSets {
 }
 
 dependencies {
-    annotationProcessor 
platform("io.micronaut:micronaut-bom:$micronautVersion")
-    implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
+    annotationProcessor 
platform("io.micronaut.platform:micronaut-platform:$micronautVersion")

Review Comment:
   Fixed in the latest commit. `grails-forge-core/build.gradle` already imports 
`io.micronaut.platform:micronaut-platform` as a platform, so `testCompileOnly 
'io.micronaut:micronaut-inject-groovy'` is now unversioned and the redundant 
`if (project.hasProperty('micronautVersion')) { ... }` guard has been dropped. 
Resolving.



##########
grails-forge/grails-forge-web-netty/build.gradle:
##########
@@ -32,6 +31,7 @@ dependencies {
     implementation 'io.micronaut.gcp:micronaut-gcp-http-client'
 
     runtimeOnly 'ch.qos.logback:logback-classic'
+    runtimeOnly 'io.micronaut:micronaut-jackson-databind'

Review Comment:
   Good catch - forge is a serde-jackson app, the jackson-databind runtime was 
a template leftover. Fixed in the latest commit: `runtimeOnly 
'io.micronaut:micronaut-jackson-databind'` -> `runtimeOnly 
'io.micronaut.serde:micronaut-serde-jackson'`. The `testCompileOnly` line on 
`micronaut-inject-groovy` has also been switched to the BOM-managed variant. 
Resolving.



##########
grails-forge/test-core/build.gradle:
##########
@@ -59,15 +59,15 @@ dependencies {
         testCompileOnly 
"io.micronaut:micronaut-inject-groovy:$micronautVersion"
     }
 
-    testImplementation "org.codehaus.groovy:groovy:$groovyVersion"
+    testImplementation "org.apache.groovy:groovy:$groovyVersion"

Review Comment:
   Fixed in the latest commit. `test-core/build.gradle` now imports 
`io.micronaut.platform:micronaut-platform` for both `implementation` and 
`testImplementation`, and all `io.micronaut:micronaut-inject-groovy` references 
are unversioned. Resolving.



##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsPluginGradlePlugin.groovy:
##########
@@ -248,19 +249,17 @@ class GrailsPluginGradlePlugin extends GrailsGradlePlugin 
{
         project.afterEvaluate() {
             ProcessResources processResources = (ProcessResources) 
project.tasks.getByName('processResources')
 
-            def processResourcesDependencies = []
-
-            processResourcesDependencies << project.task(type: Copy, 
'copyCommands') {
+            TaskProvider<Copy> copyCommands = 
project.tasks.register('copyCommands', Copy) {
                 from("${project.projectDir}/src/main/scripts")
                 into("${processResources.destinationDir}/META-INF/commands")
             }
 
-            processResourcesDependencies << project.task(type: Copy, 
'copyTemplates') {
+            TaskProvider<Copy> copyTemplates = 
project.tasks.register('copyTemplates', Copy) {
                 from("${project.projectDir}/src/main/templates")
                 into("${processResources.destinationDir}/META-INF/templates")
             }
             processResources.setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
-            processResources.dependsOn(*processResourcesDependencies)
+            processResources.dependsOn(copyCommands, copyTemplates)

Review Comment:
   Intentional - the refactor on lines 252-257 changed `project.task(type: 
Copy, 'copyCommands') { ... }` to `project.tasks.register('copyCommands', Copy) 
{ ... }` (and the same for `copyTemplates`) to migrate off the eager 
`project.task(...)` API that is problematic under Gradle 9 / 
configuration-cache. Because both task registrations are now captured as 
`TaskProvider<Copy>` locals (`copyCommands` / `copyTemplates`), the downstream 
`processResources.dependsOn(*processResourcesDependencies)` spread over a `def 
processResourcesDependencies = []` list is no longer needed - passing the two 
providers directly is both clearer and lazier. Not an AI style change. 
Resolving.



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