From 732759c3f8cc7a7f339c9ecadea2f2d603be29ff Mon Sep 17 00:00:00 2001 From: Michael Yan Date: Mon, 22 May 2023 15:02:15 +0800 Subject: [PATCH] Grails Gradle Plugin: set systemProperty 'base.dir' when running command or script --- .../org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index 786ff1af81..8502dde65e 100644 --- a/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -96,8 +96,8 @@ class GrailsGradlePlugin extends GroovyPlugin { protected static final List CORE_GORM_PLUGINS = ['hibernate4', 'hibernate5'] List> basePluginClasses = [IntegrationTestGradlePlugin] as List> - List excludedGrailsAppSourceDirs = ['migrations', 'assets'] - List grailsAppResourceDirs = ['views', 'i18n', 'conf'] + List excludedGrailsAppSourceDirs = ['assets', 'migrations', 'scripts'] + List grailsAppResourceDirs = ['conf', 'i18n', 'views'] private final ToolingModelBuilderRegistry registry String grailsAppDir String grailsVersion @@ -645,6 +645,7 @@ class GrailsGradlePlugin extends GroovyPlugin { project.tasks.create('runScript', ApplicationContextScriptTask) { classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console + project.configurations.profile systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()) + systemProperty 'base.dir', project.projectDir systemProperty "spring.devtools.restart.enabled", false if (project.hasProperty('args')) { args(CommandLineParser.translateCommandline(project.args)) @@ -659,6 +660,7 @@ class GrailsGradlePlugin extends GroovyPlugin { project.tasks.create('runCommand', ApplicationContextCommandTask) { classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console + project.configurations.profile systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName()) + systemProperty 'base.dir', project.projectDir systemProperty "spring.devtools.restart.enabled", false if (project.hasProperty('args')) { args(CommandLineParser.translateCommandline(project.args))