jamesfredley commented on code in PR #15365:
URL: https://github.com/apache/grails-core/pull/15365#discussion_r3089275588
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/profiles/GrailsProfileGradlePlugin.groovy:
##########
@@ -87,48 +87,30 @@ class GrailsProfileGradlePlugin implements Plugin<Project> {
project.configurations.named('runtimeElements')
.configure { it.extendsFrom(runtimeOnlyConfiguration.get()) }
- TaskProvider<Task> processProfileResourcesTask =
project.tasks.register('processProfileResources')
- processProfileResourcesTask.configure { Task task ->
+ // Use Sync task type instead of project.sync in doLast to avoid
Task.project access at execution time
+ // See:
https://docs.gradle.org/current/userguide/configuration_cache.html#config_cache:requirements:use_project_during_execution
+ TaskProvider<Sync> processProfileResourcesTask =
project.tasks.register('processProfileResources', Sync)
+ processProfileResourcesTask.configure { Sync task ->
task.group = 'build'
Review Comment:
Fixed. Restored the 4 \inputs.dir(...).optional().skipWhenEmpty()\
declarations. The Sync task type handles its own inputs/outputs via \rom()\,
but the explicit input declarations preserve the skip-when-empty behavior that
prevents unnecessary work when profile directories don't exist.
##########
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:
Fixed. Replaced the JSON metadata merge hack with \compileJava.enabled =
false\ since there's no Java source code in this test plugin.
##########
gradle.properties:
##########
@@ -54,15 +54,15 @@ gradleChecksumPluginVersion=1.4.0
gradleCycloneDxPluginVersion=2.4.1
Review Comment:
Fixed. Upgraded CycloneDX from 2.4.1 to 3.0.0. Rewrote SbomPlugin to use the
new \CyclonedxDirectTask\ API with property-based configuration, and updated
task name references from \cyclonedxBom\ to \cyclonedxDirectBom\.
##########
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:
Fixed. Converted \isReproducibleBuild\ to a \Provider<Boolean>\ that is
evaluated lazily at execution time via \project.provider {
lookupProperty(project, 'isReproducibleBuild') as boolean }\.
##########
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:
Fixed. Converted \uildDate\ to a \Provider<ZonedDateTime>\ that is
evaluated lazily at execution time via \project.provider {
lookupProperty(project, 'buildDate') as ZonedDateTime }\.
--
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]