bito-code-review[bot] commented on PR #15601:
URL: https://github.com/apache/grails-core/pull/15601#issuecomment-4319653064
<!-- Bito Reply -->
The current approach sets the 'grails.project.base.dir' system property at
execution time in the task's doFirst block, which can lead to caching issues. A
better way, similar to how GrailsAppBaseDirProvider might handle it, is to
configure the property lazily using Gradle's provider API on the task itself.
This ensures the property is set per task without execution-time configuration.
**grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy**
```
// Publish the project base directory so Grails' compile-time AST transform
// (GlobalGrailsClassInjectorTransformation) can locate
src/main/resources/META-INF/grails.factories
// without relying on hardcoded "build"/"target"
output-directory names.
Provider<String> projectBaseDir =
project.layout.projectDirectory.map { it.asFile.absolutePath }
c.systemProperty('grails.project.base.dir', projectBaseDir)
Closure<String> userScriptGenerator = getGroovyCompilerScript(c,
project)
c.doFirst {
```
--
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]