#!/bin/sh # Try to determine the FORREST_HOME if [ -z "$FORREST_HOME" ] ; then # Note: this piece of code is based on ant's shell script ## resolve links - $0 may be a link to ant's home PRG=$0 progname=`basename $0` saveddir=`pwd` # need this for relative symlinks cd `dirname $PRG` while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then PRG="$link" else PRG="`dirname $PRG`/$link" fi done FORREST_HOME=`dirname "$PRG"`/.. # make it fully qualified FORREST_HOME=`cd "$FORREST_HOME" && pwd` cd $saveddir fi FORRESTBOT_HOME="$FORREST_HOME/forrestbot" # set the ant file to use ANTFILE="$FORRESTBOT_HOME/forrestbot.build.xml" # Save old ANT_HOME OLD_ANT_HOME="$ANT_HOME" unset ANT_HOME # ----- Set Up The Runtime Classpath ------------------------------------------ if [ "$TERM" = "cygwin" ] ; then S=';' else S=':' fi CP="$CLASSPATH" export CP unset CLASSPATH CLASSPATH=`echo $FORREST_HOME/lib/endorsed/*.jar $FORRESTBOT_HOME/lib/*.jar | tr ' ' $S` export CLASSPATH echo "Apache Forrest. Run 'forrest -projecthelp' to list options" echo "$FORREST_HOME/ant/bin/ant" -buildfile "$ANTFILE" -Dbasedir="$PWD" -Dforrest.home="$FORREST_HOME" -emacs $@ # ---- Restore Classpath unset CLASSPATH CLASSPATH=$CP export CLASSPATH # ---- Restore ANT_HOME # Restore old ANT_HOME ANT_HOME="$OLD_ANT_HOME" export ANT_HOME