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