Browse files

GRAILS-8059 - Support relocating the spring loaded cache dir

  • Loading branch information...
1 parent 848689e commit 90d067a0ce5d42e52404b85b178bd9e286fd55e3 @jeffbrown jeffbrown committed Dec 29, 2011
View
11 grails-resources/src/grails/home/bash/startGrails
@@ -178,8 +178,17 @@ if $cygwin ; then
[ -n "$GRAILS_HOME" ] &&
AGENT_GRAILS_HOME=`cygpath --windows "$GRAILS_HOME"`
fi
+
+SPRINGLOADED_PARAMS="profile=grails"
+if [ -n "$GRAILS_AGENT_CACHE_DIR" ]; then
+ SPRINGLOADED_PARAMS="$SPRINGLOADED_PARAMS;cacheDir=$GRAILS_AGENT_CACHE_DIR"
+ if [ ! -d "$GRAILS_AGENT_CACHE_DIR" ]; then
+ mkdir -p $GRAILS_AGENT_CACHE_DIR
+ fi
+fi
+
# Process JVM args
-AGENT_STRING="-javaagent:$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-@spring.loaded.version@.jar -noverify -Dspringloaded=profile=grails"
+AGENT_STRING="-javaagent:$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-@spring.loaded.version@.jar -noverify -Dspringloaded=$SPRINGLOADED_PARAMS"
CMD_LINE_ARGS=""
DISABLE_RELOADING=false
View
8 grails-resources/src/grails/home/bash/startGrails.bat
@@ -57,7 +57,13 @@ if "%GRAILS_HOME%" == "" set GRAILS_HOME=%DIRNAME%..
:init
-set AGENT_STRING=-javaagent:%GRAILS_HOME:\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-@spring.loaded.version@.jar -noverify -Dspringloaded=profile=grails
+set SPRINGLOADED_PARAMS="profile=grails"
+if not "%GRAILS_AGENT_CACHE_DIR%" == "" (
+set SPRINGLOADED_PARAMS="%SPRINGLOADED_PARAMS%;cacheDir=%GRAILS_AGENT_CACHE_DIR%"
+if not exist "%GRAILS_AGENT_CACHE_DIR%" mkdir "%GRAILS_AGENT_CACHE_DIR%"
+)
+set AGENT_STRING=-javaagent:%GRAILS_HOME:\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-@spring.loaded.version@.jar -noverify -Dspringloaded=%SPRINGLOADED_PARAMS%
+
set DISABLE_RELOADING=
if "%GRAILS_OPTS%" == "" set GRAILS_OPTS=-server -Xmx768M -Xms768M -XX:PermSize=256m -XX:MaxPermSize=256m -Dfile.encoding=UTF-8

0 comments on commit 90d067a

Please sign in to comment.