jdaugherty commented on code in PR #15601:
URL: https://github.com/apache/grails-core/pull/15601#discussion_r3141956978


##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -196,8 +196,13 @@ class GrailsGradlePlugin extends GroovyPlugin {
             Provider<RegularFile> groovyCompilerConfigFile = 
project.layout.buildDirectory.file("grailsGroovyCompilerConfig-${c.name}.groovy")
             c.outputs.file(groovyCompilerConfigFile)
 
+            // 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.
+            String projectBaseDir = 
project.layout.projectDirectory.asFile.absolutePath
             Closure<String> userScriptGenerator = getGroovyCompilerScript(c, 
project)
             c.doFirst {
+                System.setProperty('grails.project.base.dir', projectBaseDir)

Review Comment:
   This isn't the correct way to do this.  Take a look at 
GrailsAppBaseDirProvider - we should do something similar to set this property 
for these tasks.



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