Skip to content

Commit d39323a

Browse files
author
graeme
committed
fix for GRAILS-2657
git-svn-id: https://svn.codehaus.org/grails/trunk@6808 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent 29282d9 commit d39323a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

scripts/War.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,11 @@ DEFAULT_J5_DEPS = [
9090
"ejb3-persistence.jar",
9191
]
9292

93+
target (configureRunningScript:"Sets the currently running script, in case called directly") {
94+
System.setProperty('current.gant.script',"war")
95+
}
9396
target (war: "The implementation target") {
94-
depends( clean, packageApp)
97+
depends( configureRunningScript, clean, packageApp)
9598

9699
try {
97100
stagingDir = "${basedir}/staging"

src/commons/org/codehaus/groovy/grails/cli/GrailsScriptRunner.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Grails home is set to: ${grailsHome}
143143
private static setDefaultEnvironment(args) {
144144
if(!System.properties."${GrailsApplication.ENVIRONMENT}") {
145145
def environment = DEFAULT_ENVS[args.toLowerCase()]
146-
environment = environment ? ENV_ARGS[environment] : ENV_ARGS['dev']
146+
environment = environment ?: GrailsApplication.ENV_DEVELOPMENT
147147
System.setProperty(GrailsApplication.ENVIRONMENT, environment )
148148
System.setProperty(GrailsApplication.ENVIRONMENT_DEFAULT, "true")
149149
}

src/commons/org/codehaus/groovy/grails/commons/GrailsApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ public interface GrailsApplication extends ApplicationContextAware {
7373
* Constant used to resolve the environment via System.getProperty(ENVIRONMENT)
7474
*/
7575
String ENVIRONMENT = "grails.env";
76+
77+
/**
78+
* Constants that indicates whether this GrailsApplication is running in the default environment
79+
*/
80+
String ENVIRONMENT_DEFAULT = "grails.env.default";
81+
7682
/**
7783
* Constant for the development environment
7884
*/

0 commit comments

Comments
 (0)