Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 67 lines (51 sloc) 1.48 KB
#!/bin/bash
function path_append {
_var=$1
_path=$2
eval "
if [[ -z \"\$$_var\" ]] ; then
export $_var=$_path
elif ! echo \$$_var | egrep -q \"(^|:)$_path($|:)\" ; then
export $_var=\$$_var:$_path
fi"
}
function find_sbt_root {
while [ ! -d project -a "x$PWD" != "x/" ] ; do
cd ..
done
if [ "x$PWD" = "/" ]; then
echo "couldn't find sbt project!" 1>&2
exit 1
fi
echo $PWD
}
root=$(find_sbt_root)
if [ $? -ne 0 ]; then
exit 1
fi
## Set up the classpath-- one for each (sub)project.
path_append CP $root/project/boot/scala-2.8.1/lib/scala-library.jar
path_append CP $root/project/boot/scala-2.8.1/lib/scala-compiler.jar
for project in $root/finagle-* ; do
for jar in $project/lib_managed/compile/*.jar; do
path_append CP $jar
done
for lib in $project/lib/*.jar; do
path_append CP $jar
done
path_append CP $project/target/resources
path_append CP $project/target/classes
done
# To use YourKit:
#export JAVA_OPTS=-agentlib:yjpagent
if [ "$GCLOG" = "1" ]; then
GC_OPTS="-verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:/tmp/gc.log"
fi
if [ "$PROFILE" = "1" ]; then
JAVA_OPTS="-agentlib:yjpagent $JAVA_OPTS"
fi
if [ "$DEBUG" = "1" ]; then
export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n $JAVA_OPTS"
fi
export JAVA_OPTS="$JAVA_OPTS -server -Xmx2G -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+UseParNewGC $GC_OPTS"
exec java $JAVA_OPTS -cp $CP "$@"