Jonathan Hart | fe99038 | 2013-02-06 15:22:32 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
HIGUCHI Yuta | e7aa925 | 2013-06-06 14:54:21 -0700 | [diff] [blame] | 3 | ONOS_DIR="`dirname $0`/.." |
| 4 | #CP=$( echo `dirname $0`/../lib/*.jar `dirname $0`/../lib/titan/*.jar . | sed 's/ /:/g') |
| 5 | CP=`mvn -f ${ONOS_DIR}/pom.xml dependency:build-classpath -Dmdep.outputFile=/dev/stdout -l /dev/stderr` |
Jonathan Hart | fe99038 | 2013-02-06 15:22:32 -0800 | [diff] [blame] | 6 | |
| 7 | # Find Java |
| 8 | if [ "$JAVA_HOME" = "" ] ; then |
| 9 | JAVA="java -server" |
| 10 | else |
| 11 | JAVA="$JAVA_HOME/bin/java -server" |
| 12 | fi |
| 13 | |
| 14 | # Set Java options |
| 15 | if [ "$JAVA_OPTIONS" = "" ] ; then |
| 16 | JAVA_OPTIONS="-Xms32m -Xmx512m" |
| 17 | fi |
| 18 | |
| 19 | # Launch the application |
| 20 | if [ "$1" = "-e" ]; then |
| 21 | k=$2 |
| 22 | if [ $# -gt 2 ]; then |
| 23 | for (( i=3 ; i < $# + 1 ; i++ )) |
| 24 | do |
| 25 | eval a=\$$i |
| 26 | k="$k \"$a\"" |
| 27 | done |
| 28 | fi |
| 29 | |
| 30 | eval $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.ScriptExecutor $k |
| 31 | else |
| 32 | if [ "$1" = "-v" ]; then |
| 33 | $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.tinkerpop.gremlin.Version |
| 34 | else |
| 35 | $JAVA $JAVA_OPTIONS -cp $CP:$CLASSPATH com.thinkaurelius.titan.tinkerpop.gremlin.Console |
| 36 | fi |
| 37 | fi |
| 38 | |
| 39 | # Return the program's exit code |
| 40 | exit $? |