#!/bin/sh

#CACHE_HOME=/home/head/cvsroot/jboss-head/cache/output/tmp
CACHE_HOME=`dirname $0`
CACHE_LIB=$CACHE_HOME/lib
CACHE_OUTPUT=$CACHE_HOME/output

CLASSPATH=$CACHE_LIB/commons-logging.jar:$CACHE_LIB/bsh-2.0b4.jar:$CACHE_LIB/jboss-aop.jar:$CACHE_LIB/jboss-j2ee.jar:$CACHE_LIB/jgroups.jar:$CACHE_LIB/jboss-cache.jar:$CACHE_LIB/jboss-jmx.jar:$CACHE_LIB/trove.jar:$CACHE_LIB/javassist.jar:$CACHE_LIB/jboss-minimal.jar:$CACHE_LIB/jboss-common.jar:$CACHE_LIB/jboss-system.jar:$CACHE_LIB/log4j.jar:$CACHE_LIB/concurrent.jar:$CACHE_LIB/je.jar:$CACHE_LIB/jboss-remoting.jar:$CACHE_LIB/jboss-serialization.jar


CLASSPATH=$CLASSPATH:$CACHE_OUTPUT/etc:$CACHE_OUTPUT/classes

AOP_PATH=$CACHE_OUTPUT/etc/META-INF

LOG4J=$CACHE_OUTPUT/etc/log4j.xml

# OS specific support (must be 'true' or 'false').
cygwin=false;
case "`uname`" in
    CYGWIN*)
        cygwin=true
        ;;
esac

if [ $cygwin = "true" ]; then
   CP=`cygpath -wp $CLASSPATH`
   L4J=`cygpath -wp $LOG4J`
else
   CP=$CLASSPATH
   L4J=$LOG4J
fi

#JAVA_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n"

# Use aopc now instead of load-time mode
sh build.sh aopc
ARGS="-Dlog4j.configuration=file:$L4J"



java -cp $CP $ARGS $JAVA_OPTS -Djboss.aop.aoppath=$AOP_PATH  bsh.Console &
