--- JavaGAT-1.6/bin/run_gat_app 2006-11-08 16:36:06.000000000 +0100 +++ JavaGAT-1.6-jjk/bin/run_gat_app 2007-01-30 15:27:31.000000000 +0100 @@ -1,35 +1,31 @@ -#!/bin/sh - -if [ -z "$GAT_LOCATION" ] ; then -# echo GAT_LOCATION variable not set, using $PWD - GAT_LOCATION=$PWD +#!/bin/bash + +if [ -z "$GAT_LOCATION" ] +then + echo GAT_LOCATION variable not set, using ${0%/bin/*} + GAT_LOCATION=${0%/bin/*} fi - # ---- do not touch anything below this line ---- - + GAT_ENGINE_LOCATION=$GAT_LOCATION/engine GAT_ADAPTOR_LOCATION=$GAT_LOCATION/adaptors -GAT_GRIDLAB_ADAPTOR_LOCATION=$GAT_LOCATION/gridlabAdaptors -GAT_TESTS_LOCATION=$GAT_LOCATION/tests -add_to_gat_classpath () { - DIRLIBS=${1}/*.jar - for i in ${DIRLIBS} - do - # if the directory is empty, then it will return the input string - # this is stupid, so case for it - if [ "$i" != "${DIRLIBS}" ] ; then - if [ -z "$GAT_CLASSPATH" ] ; then - GAT_CLASSPATH=$i - else - GAT_CLASSPATH="$i":$GAT_CLASSPATH - fi - fi - done +add_to_gat_classpath () +{ + for i in "$1"/*.jar + do + GAT_CLASSPATH="${GAT_CLASSPATH:+$GAT_CLASSPATH:}$i" + done } +# build the regular CLASSPATH first, using the JPackage build-classpath script +CLASSPATH=`build-classpath puretls commons-cli commons-logging commons-discovery junit \ + jzlib log4j j2ssh-core jsch cryptix-asn1 cryptix cryptix32` + +add_to_gat_classpath $IBIS_HOME/lib add_to_gat_classpath $GAT_ENGINE_LOCATION/lib -add_to_gat_classpath $GAT_TESTS_LOCATION/lib +add_to_gat_classpath $GAT_ADAPTOR_LOCATION/lib + +$JAVA_HOME/bin/java -cp $CLASSPATH:$GAT_CLASSPATH -Dlog4j.configuration=file:$GAT_LOCATION/log4j.properties -Dgat.adaptor.path=$GAT_ADAPTOR_LOCATION/lib $@ -java -cp $CLASSPATH:$GAT_CLASSPATH -Dlog4j.configuration=file:$GAT_LOCATION/log4j.properties -Dgat.adaptor.path=$GAT_ADAPTOR_LOCATION/lib:$GAT_GRIDLAB_ADAPTOR_LOCATION/lib $*