jdaugherty commented on code in PR #15127:
URL: https://github.com/apache/grails-core/pull/15127#discussion_r2426897483
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -427,6 +427,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileStatic
protected String configureGrailsBuildSettings(Project project) {
System.setProperty(BuildSettings.APP_BASE_DIR,
project.projectDir.absolutePath)
+ System.setProperty(BuildSettings.PROJECT_TARGET_DIR,
project.layout.buildDirectory.get().asFile.name)
Review Comment:
I don't believe this is needed because configureForkSettings copies any
grails property and sets it on javaexec / test.
##########
grails-gradle/model/src/main/groovy/grails/util/BuildSettings.groovy:
##########
@@ -253,7 +253,7 @@ class BuildSettings {
}
BASE_DIR = System.getProperty(APP_BASE_DIR) ? new
File(System.getProperty(APP_BASE_DIR)) :
(IOUtils.findApplicationDirectoryFile() ?: new File('.'))
GRAILS_APP_DIR_PRESENT = new File(BASE_DIR, 'grails-app').exists() ||
new File(BASE_DIR, 'Application.groovy').exists()
- TARGET_DIR = new File(BASE_DIR, 'build')
+ TARGET_DIR = System.getProperty(PROJECT_TARGET_DIR) ? new
File(BASE_DIR, System.getProperty(PROJECT_TARGET_DIR)) : new File(BASE_DIR,
'build')
Review Comment:
I think this is a breaking change too. Going back to 3/29/24 in the logs,
this never overrode TARGET_DIR.
##########
grails-gradle/model/src/main/groovy/grails/util/BuildSettings.groovy:
##########
@@ -253,7 +253,7 @@ class BuildSettings {
}
BASE_DIR = System.getProperty(APP_BASE_DIR) ? new
File(System.getProperty(APP_BASE_DIR)) :
(IOUtils.findApplicationDirectoryFile() ?: new File('.'))
GRAILS_APP_DIR_PRESENT = new File(BASE_DIR, 'grails-app').exists() ||
new File(BASE_DIR, 'Application.groovy').exists()
- TARGET_DIR = new File(BASE_DIR, 'build')
+ TARGET_DIR = System.getProperty(PROJECT_TARGET_DIR) ? new
File(BASE_DIR, System.getProperty(PROJECT_TARGET_DIR)) : new File(BASE_DIR,
'build')
Review Comment:
What's the use case for having this set? The reason we removed
PROJECT_TARGET_DIR is because it wasn't used. You can easily inject this via
gradle, and BuildSettings is really a left over artifact from the original
grails build system. We are trying to remove this functionality over time
since it's specific to dev mode and gradle is the better place for that logic.
--
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]