Skip to content

Commit

Permalink
Use property getter for compatibility with Java classes (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Feb 8, 2023
1 parent e47123e commit 6b1948b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class GrailsGradlePlugin extends GroovyPlugin {


Task buildPropertiesTask = project.tasks.create("buildProperties")
Map<String, Object> buildPropertiesContents = ['grails.env': Environment.isSystemSet() ? Environment.current.name : Environment.PRODUCTION.name,
Map<String, Object> buildPropertiesContents = ['grails.env': Environment.isSystemSet() ? Environment.getCurrent().getName() : Environment.PRODUCTION.getName(),
'info.app.name': project.name,
'info.app.version': project.version instanceof Serializable ? project.version : project.version.toString(),
'info.app.grailsVersion': project.properties.get('grailsVersion')]
Expand Down Expand Up @@ -431,8 +431,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
TaskContainer tasks = project.tasks

String grailsEnvSystemProperty = System.getProperty(Environment.KEY)
tasks.withType(Test).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.TEST.name)
tasks.withType(JavaExec).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.DEVELOPMENT.name)
tasks.withType(Test).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.TEST.getName())
tasks.withType(JavaExec).each systemPropertyConfigurer.curry(grailsEnvSystemProperty ?: Environment.DEVELOPMENT.getName())
}

protected void configureConsoleTask(Project project) {
Expand Down Expand Up @@ -606,7 +606,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
if (project.tasks.findByName("runScript") == null) {
project.tasks.create("runScript", ApplicationContextScriptTask) {
classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console
systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.name)
systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
if (project.hasProperty('args')) {
args(CommandLineParser.translateCommandline(project.args))
}
Expand All @@ -619,7 +619,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
if (project.tasks.findByName("runCommand") == null) {
project.tasks.create("runCommand", ApplicationContextCommandTask) {
classpath = project.sourceSets.main.runtimeClasspath + project.configurations.console
systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.name)
systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
if (project.hasProperty('args')) {
args(CommandLineParser.translateCommandline(project.args))
}
Expand Down

0 comments on commit 6b1948b

Please sign in to comment.