use stripped PROJECT_TARGET_DIR for setting TARGET_DIR#15179
use stripped PROJECT_TARGET_DIR for setting TARGET_DIR#15179jdaugherty merged 3 commits intoapache:7.0.xfrom
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.
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.
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