Skip to content

Commit

Permalink
if the configured output directories in BuildConfig are not absolute,…
Browse files Browse the repository at this point in the history
… make them relative the project directory. Ensures output paths are correct for multi-project builds
  • Loading branch information
graemerocher committed Apr 26, 2012
1 parent 380eb5f commit fb060c8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,9 @@ class BuildSettings extends AbstractBuildSettings {

if (!projectTargetDirSet) {
projectTargetDir = new File(getPropertyValue(PROJECT_TARGET_DIR, props, "$baseDir/target"))
if(!projectTargetDir.absolute) {
projectTargetDir = new File(baseDir, projectTargetDir.path)
}
}

if (!projectWarFileSet) {
Expand All @@ -1367,6 +1370,9 @@ class BuildSettings extends AbstractBuildSettings {
def warName = version ? "$baseDir/target/${appName}-${version}.war" : "$baseDir/target/${appName}.war"

projectWarFile = new File(getPropertyValue(PROJECT_WAR_FILE, props, warName))
if(!projectWarFile.absolute) {
projectWarFile = new File(baseDir, projectWarFile.path)
}
}

if (!projectWarExplodedDirSet) {
Expand All @@ -1384,22 +1390,41 @@ class BuildSettings extends AbstractBuildSettings {

if (!classesDirSet) {
classesDir = new File(getPropertyValue(PROJECT_CLASSES_DIR, props, "$projectWorkDir/classes"))
if(!classesDir.absolute) {
classesDir = new File(baseDir, classesDir.path)
}
}

if (!testClassesDirSet) {
testClassesDir = new File(getPropertyValue(PROJECT_TEST_CLASSES_DIR, props, "$projectWorkDir/test-classes"))
if(!testClassesDir.absolute) {
testClassesDir = new File(baseDir, testClassesDir.path)
}

}

if (!pluginClassesDirSet) {
pluginClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_CLASSES_DIR, props, "$projectWorkDir/plugin-classes"))
if(!pluginClassesDir.absolute) {
pluginClassesDir = new File(baseDir, pluginClassesDir.path)
}

}

if (!pluginBuildClassesDirSet) {
pluginBuildClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_BUILD_CLASSES_DIR, props, "$projectWorkDir/plugin-build-classes"))
if(!pluginBuildClassesDir.absolute) {
pluginBuildClassesDir = new File(baseDir, pluginBuildClassesDir.path)
}

}

if (!pluginProvidedClassesDirSet) {
pluginProvidedClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_PROVIDED_CLASSES_DIR, props, "$projectWorkDir/plugin-provided-classes"))
if(!pluginProvidedClassesDir.absolute) {
pluginProvidedClassesDir = new File(baseDir, pluginProvidedClassesDir.path)
}

}

if (!resourcesDirSet) {
Expand All @@ -1424,10 +1449,16 @@ class BuildSettings extends AbstractBuildSettings {

if (!testReportsDirSet) {
testReportsDir = new File(getPropertyValue(PROJECT_TEST_REPORTS_DIR, props, "${projectTargetDir}/test-reports"))
if(!testReportsDir.absolute) {
testReportsDir = new File(baseDir, testReportsDir.path)
}
}

if (!docsOutputDirSet) {
docsOutputDir = new File(getPropertyValue(PROJECT_DOCS_OUTPUT_DIR, props, "${projectTargetDir}/docs"))
if(!docsOutputDir.absolute) {
docsOutputDir = new File(baseDir, docsOutputDir.path)
}
}

if (!testSourceDirSet) {
Expand Down

0 comments on commit fb060c8

Please sign in to comment.