Skip to content

Commit 0de145d

Browse files
authored
Merge pull request #15127 from codeconsole/7.0.x-buildSettingsFix
2 parents 0b1d127 + 227c556 commit 0de145d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

grails-gradle/model/src/main/groovy/grails/util/BuildSettings.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class BuildSettings {
253253
}
254254
BASE_DIR = System.getProperty(APP_BASE_DIR) ? new File(System.getProperty(APP_BASE_DIR)) : (IOUtils.findApplicationDirectoryFile() ?: new File('.'))
255255
GRAILS_APP_DIR_PRESENT = new File(BASE_DIR, 'grails-app').exists() || new File(BASE_DIR, 'Application.groovy').exists()
256-
TARGET_DIR = new File(BASE_DIR, 'build')
256+
TARGET_DIR = System.getProperty(PROJECT_TARGET_DIR) ? new File(BASE_DIR, System.getProperty(PROJECT_TARGET_DIR)) : new File(BASE_DIR, 'build')
257257
RESOURCES_DIR = !GRAILS_APP_DIR_PRESENT ? null : (System.getProperty(PROJECT_RESOURCES_DIR) ? new File(System.getProperty(PROJECT_RESOURCES_DIR)) : new File(TARGET_DIR, 'resources/main'))
258258
}
259259
}

grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
427427
@CompileStatic
428428
protected String configureGrailsBuildSettings(Project project) {
429429
System.setProperty(BuildSettings.APP_BASE_DIR, project.projectDir.absolutePath)
430+
System.setProperty(BuildSettings.PROJECT_TARGET_DIR, project.layout.buildDirectory.get().asFile.name)
430431
}
431432

432433
@CompileDynamic

0 commit comments

Comments
 (0)