-
-
Save jousby/3922247 to your computer and use it in GitHub Desktop.
Play Framework 2.0 start scripts for Cygwin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
PLAY_VERSION="2.0.4" | |
if [ -z "${JPDA_PORT}" ]; then | |
DEBUG_PARAM="" | |
else | |
DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${JPDA_PORT}" | |
fi | |
java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M \ | |
-Dfile.encoding=UTF8 \ | |
-Dplay.version=$PLAY_VERSION \ | |
-Dsbt.boot.properties=$SBT_BOOT_PROPS \ | |
$JAVA_CMD_TAIL | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env sh | |
PRG="$0" | |
while [ -h "$PRG" ] ; do | |
PRG=`readlink "$PRG"` | |
done | |
dir=`dirname $PRG` | |
PLAY_HOME=$(cygpath -w -a $dir) | |
PLAY_FRAMEWORK_HOME=$(cygpath -w -a $PLAY_HOME/framework) | |
PLAY_BOOT_PROPS=file:///$(cygpath -m -a $PLAY_FRAMEWORK_HOME/sbt/play.boot.properties) | |
SBT_IVY_HOME=$(cygpath -w -a $PLAY_HOME/repository) | |
SBT_LAUNCH_JAR=$(cygpath -w -a $PLAY_FRAMEWORK_HOME/sbt/sbt-launch.jar) | |
export SBT_BOOT_PROPS=file:///$(cygpath -m -a $PLAY_FRAMEWORK_HOME/sbt/sbt.boot.properties) | |
JLINE_TERMINAL=-Djline.terminal=jline.UnixTerminal | |
stty -icanon min 1 -echo | |
export JAVA_CMD_TAIL="$JLINE_TERMINAL -Dsbt.ivy.home=$SBT_IVY_HOME -Dplay.home=$PLAY_FRAMEWORK_HOME -jar $SBT_LAUNCH_JAR $@" | |
if [ -f conf/application.conf ]; then | |
if test "$1" = "clean-all"; then | |
rm -rf target | |
rm -rf tmp | |
rm -rf logs | |
rm -rf dist | |
rm -rf project/project | |
rm -rf project/target | |
if [ $# -ne 1 ] | |
then | |
shift | |
else | |
echo "[info] Done!" | |
exit 0 | |
fi | |
fi | |
if test "$1" = "stop"; then | |
if [ -f RUNNING_PID ]; then | |
echo "[info] Stopping application (with PID `cat RUNNING_PID`)..." | |
kill `cat RUNNING_PID` | |
RESULT=$? | |
if test "$RESULT" = 0; then | |
echo "[info] Done!" | |
exit 0 | |
else | |
echo "[\033[31merror\033[0m] Failed ($RESULT)" | |
exit $RESULT | |
fi | |
else | |
echo "[\033[31merror\033[0m] No RUNNING_PID file. Is this application running?" | |
exit 1 | |
fi | |
fi | |
if test "$1" = "debug"; then | |
JPDA_PORT="9999" | |
shift | |
fi | |
if [ -n "$1" ]; then | |
JPDA_PORT="${JPDA_PORT}" $dir/framework/build.cygwin.sh "$@" | |
else | |
JPDA_PORT="${JPDA_PORT}" $dir/framework/build.cygwin.sh play | |
fi | |
else | |
java -Dsbt.boot.properties=$PLAY_BOOT_PROPS $JAVA_CMD_TAIL | |
fi | |
stty echo icanon |
Updated based on this gist -> https://gist.github.com/3923047
The caveats mentioned above are fixed now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Alternatives for the following two files in the framework distribution to be used under cygwin on Windows.
PLAY_HOME/play
PLAY_HOME/framework/build
Caveats: