forked from lift/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
liftsh
executable file
·31 lines (23 loc) · 1.26 KB
/
liftsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# Make sure to change the name of the launcher jar and the source when bumping sbt version
# so that the existence test below fails and we download the new jar.
SBT_LAUNCHER_PATH="project/sbt-launch-0.13.5.jar"
SBT_LAUNCHER_SOURCE="http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.5/sbt-launch.jar"
# Download the sbt launcher on-the-fly if it's not already in the repository.
if test ! -f $SBT_LAUNCHER_PATH; then
echo "Downloading sbt launcher..."
curl -o ${SBT_LAUNCHER_PATH} ${SBT_LAUNCHER_SOURCE}
fi
# Load custom liftsh config
if test -f ~/.liftsh.config; then
. ~/.liftsh.config
fi
# Internal options, always specified
INTERNAL_OPTS="-Dfile.encoding=UTF-8 -Xmx1768m -noverify -XX:ReservedCodeCacheSize=296m -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=812m"
# Add 64bit specific option
exec java -version 2>&1 | grep -q "64-Bit" && INTERNAL_OPTS="${INTERNAL_OPTS} -XX:+UseCompressedOops -XX:ReservedCodeCacheSize=328m"
# Default options, if nothing is specified
DEFAULT_OPTS=""
cd `dirname $0`
# Call with INTERNAL_OPTS followed by LIFTSH_OPTS (or DEFAULT_OPTS). java always takes the last option when duplicate.
exec java ${INTERNAL_OPTS} ${LIFTSH_OPTS:-${DEFAULT_OPTS}} -jar ${SBT_LAUNCHER_PATH} "$@"