forked from twitter/finagle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
executable file
·66 lines (51 loc) · 1.49 KB
/
run
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/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 ../ostrich ../util; 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 "$@"