matrei commented on code in PR #15179:
URL: https://github.com/apache/grails-core/pull/15179#discussion_r2472406262


##########
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 = System.getProperty(PROJECT_TARGET_DIR) ? new 
File(BASE_DIR, System.getProperty(PROJECT_TARGET_DIR)) : new File(BASE_DIR, 
'build')
+        TARGET_DIR = new File(BASE_DIR, 
System.getProperty(PROJECT_TARGET_DIR.substring(7)) ?: 'build')

Review Comment:
   I agree with your comment, in this case it's better to not use the constant.
   Also `System.getProperty` has a version that takes a default value:
   ```groovy
   System.getProperty('project.target.dir', 'build')
   ```



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