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


##########
.sdkmanrc:
##########
@@ -2,5 +2,5 @@
 java=17.0.18-librca
 # Keep gradle version synced with gradle.properties (gradleToolingApiVersion), 
all gradle-wrapper.properties files,

Review Comment:
   Confirmed still in place. `.sdkmanrc` now reads `Update the gradle-bootstrap 
project to propagate the version to all gradle-wrapper.properties files.` - 
resolving.



##########
grails-gradle/bom/build.gradle:
##########
@@ -43,8 +43,9 @@ dependencies {
         exclude group: 'com.fasterxml.jackson'
     }
 
-    // Because gradle uses groovy 3, we must use groovy 3 compatible versions 
for the grails-gradle-bom
-    api platform("org.codehaus.groovy:groovy-bom:${GroovySystem.version}")
+    // Use Gradle's embedded Groovy version for the grails-gradle-bom
+    // Groovy 4+ uses org.apache.groovy coordinates
+    api platform("org.apache.groovy:groovy-bom:${GroovySystem.version}")

Review Comment:
   Confirmed still in place. `grails-gradle/bom/build.gradle` imports 
`gradleBomPlatformDependencies['gradle-groovy-bom']` and the version lives in 
`dependencies.gradle` as `gradle-groovy.version: 4.0.31`. Resolving.



##########
grails-test-examples/plugins/issue-11767/build.gradle:
##########
@@ -40,3 +40,29 @@ apply {
     from 
rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
     from 
rootProject.layout.projectDirectory.file('gradle/grails-extension-gradle-config.gradle')
 }
+
+// Both compileJava and compileGroovy run the Micronaut annotation processor, 
each generating

Review Comment:
   The `compileJava.enabled = false` workaround you commented on was actually 
wrong and I had to undo it in `237527b` - the plugin does have Java code 
(`PluginJavaMicronautBean`) that 
`grails-test-examples/issue-11767/AppController.groovy` imports, so disabling 
`compileJava` broke the downstream `compileGroovy`. The current fix is a 
dedicated `mergeMicronautConfigMetadata` task that merges the two 
non-overlapping metadata files (one from `micronaut-inject-java`, one from 
`micronaut-inject-groovy`) into a single 
`META-INF/spring-configuration-metadata.json` that describes both beans. Full 
root-cause explanation is in the file comment block. Resolving.



##########
gradle.properties:
##########
@@ -54,15 +54,15 @@ gradleChecksumPluginVersion=1.4.0
 gradleCycloneDxPluginVersion=2.4.1

Review Comment:
   Confirmed still in place. `gradle.properties` now has 
`gradleCycloneDxPluginVersion=3.0.0` and `SbomPlugin` uses the new 
`CyclonedxDirectTask` API. Resolving.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in 
the sbom
                 // see: 
https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid 
deprecated Task.project access at execution time
+                // See: 
https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 
'isReproducibleBuild')
+                ZonedDateTime buildDate = lookupProperty(project, 'buildDate')

Review Comment:
   Confirmed still in place - `isReproducibleBuild` is a `Provider<Boolean>` 
evaluated lazily at execution time (line 218). Your follow-up clarification 
that it's a perf optimisation is noted. Resolving.



##########
build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy:
##########
@@ -208,6 +209,12 @@ class SbomPlugin implements Plugin<Project> {
 
                 // cyclonedx does not support "choosing" the license placed in 
the sbom
                 // see: 
https://github.com/CycloneDX/cyclonedx-gradle-plugin/issues/16
+                // Capture project name at configuration time to avoid 
deprecated Task.project access at execution time
+                // See: 
https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+                def projectName = project.name
+                def projectPath = project.path
+                boolean isReproducibleBuild = lookupProperty(project, 
'isReproducibleBuild')

Review Comment:
   Confirmed still in place - `buildDate` is a `Provider<ZonedDateTime>` 
evaluated lazily at execution time (line 219). Resolving.



##########
build-logic/docs-core/src/main/groovy/org/apache/grails/gradle/tasks/bom/ExtractDependenciesTask.groovy:
##########
@@ -83,17 +86,26 @@ abstract class ExtractDependenciesTask extends DefaultTask {
     @Input
     abstract MapProperty<String, String> getProjectCoordinateProperties()
 
+    // Captured at configuration time to avoid deprecated Task.project access 
at execution time.
+    // See: 
https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+    @Internal
+    DependencyHandler dependencyHandler
+
+    @Internal
+    ConfigurationContainer configurationContainer
+
     void setConfiguration(NamedDomainObjectProvider<Configuration> config) {
         dependencyArtifacts.from(config)
         configurationName.set(config.name)
     }
 
-    ExtractDependenciesTask() {
-        doFirst {
-            if (!project.pluginManager.hasPlugin('java-platform')) {

Review Comment:
   Addressed differently based on your adjacent comment about 
`grails-bom/build.gradle` line 112 (#3094057606): the `java-platform` plugin 
check is only useful for external consumers of the task, and we do not ship 
this task externally, so I removed the check entirely rather than trying to 
persist a `PluginManager` reference. That sidesteps the `doFirst` / doAction 
dance altogether and matches your guidance for the adjacent thread. The 
`DependencyHandler` and `ConfigurationContainer` continue to be captured at 
configuration time via `captureProjectServices(...)`. 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