forked from lsds/Saber
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·68 lines (50 loc) · 1.85 KB
/
run.sh
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
67
68
#!/bin/bash
USAGE="usage: ./run.sh [class name]"
MVN="/home/akolious/.m2/repository"
# LOG4J="${MVN}/log4j/log4j/1.2.12/log4j-1.2.12.jar"
JETTYSERVER="${MVN}/org/eclipse/jetty/jetty-server/9.0.0.v20130308/jetty-server-9.0.0.v20130308.jar"
JETTYUTIL="${MVN}/org/eclipse/jetty/jetty-util/9.0.0.v20130308/jetty-util-9.0.0.v20130308.jar"
JETTYHTTP="${MVN}/org/eclipse/jetty/jetty-http/9.0.0.v20130308/jetty-http-9.0.0.v20130308.jar"
JETTYIO="${MVN}/org/eclipse/jetty/jetty-io/9.0.0.v20130308/jetty-io-9.0.0.v20130308.jar"
JACKSONCORE="${MVN}/com/fasterxml/jackson/core/jackson-core/2.1.4/jackson-core-2.1.4.jar"
JACKSONBIND="${MVN}/com/fasterxml/jackson/core/jackson-databind/2.1.4/jackson-databind-2.1.4.jar"
JACKSONANNOTATIONS="${MVN}/com/fasterxml/jackson/core/jackson-annotations/2.1.4/jackson-annotations-2.1.4.jar"
JAVAX="${MVN}/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar"
TESTS="target/test-classes"
if [ ! -f "lib/saber-0.0.1-SNAPSHOT.jar" ]; then
echo "error: lib/saber-0.0.1-SNAPSHOT.jar not found. Try 'build.sh' first"
exit 1
fi
if [ ! -f ${LOG4J} ]; then
echo "error: ${LOG4J} not found"
exit 1
fi
if [ ! -d ${TESTS} ]; then
echo "error: ${TESTS} not found"
exit 1
fi
# Set classpath
JCP="."
JCP="${JCP}:lib/saber-0.0.1-SNAPSHOT.jar"
# JCP="${JCP}:${LOG4J}"
JCP="${JCP}:${JETTYSERVER}:${JETTYUTIL}:${JETTYHTTP}:${JETTYIO}"
JCP="${JCP}:${JACKSONCORE}:${JACKSONBIND}:${JACKSONANNOTATIONS}"
JCP="${JCP}:${JAVAX}"
JCP="${JCP}:${TESTS}"
# OPTS="-Xloggc:test-gc.out"
OPTS="-server -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -XX:SurvivorRatio=16 -Xms8g -Xmx8g"
if [ $# -lt 1 ]; then
echo "error: unspecified application class"
else
CLASS=$1
shift 1
fi
CLASSFILE="${TESTS}/`echo ${CLASS} | tr '.' '/'`.class"
if [ ! -f ${CLASSFILE} ]; then
echo "error: ${CLASSFILE} not found"
exit 1
fi
java $OPTS -cp $JCP $CLASS $@
echo "Done."
echo "Bye."
exit 0