-
-
Notifications
You must be signed in to change notification settings - Fork 966
use stripped PROJECT_TARGET_DIR for setting TARGET_DIR #15179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use stripped PROJECT_TARGET_DIR for setting TARGET_DIR #15179
Conversation
|
Why is The message of the commit that added that code in 2015 is: That implies to me that this is done to convert Would it not be more transparent to explicitly convert the Spring Boot properties that we care about in |
@matrei this PR isn't stripping anything. All this PR does is reference the historically correct
yes, I agree with everything you are saying, but we should prob not be that invasive until 8.x, no? |
|
An alternative for this PR is not reference the constant at all. TARGET_DIR = new File(BASE_DIR, System.getProperty('target.dir') ?: 'build') |
| 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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
System.getProperty('project.target.dir', 'build')There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that's what I meant.
grails.is stripped out of all build settings when the jvm is forked.This correctly sets the TARGET_DIR after it has been stripped by using
project.target.dirDifference from 7.0.0
to