#!/bin/sh
#
# $Id: ant,v 1.1 2002/02/05 21:39:22 mdb Exp $
#
# Invokes our desired version of ant with all of our jar files in the
# classpath.

BINDIR=`dirname $0`
ANT_OPTS="-Dbuild.compiler=jikes"

# Load default settings from config file (if it exists)
if [ -f "$HOME/.antrc" ]; then
  . "$HOME/.antrc"
fi

# determine whether or not we want optimization off
if [ "$1" == "-d" ]; then
    shift
    ANT_OPTS="$ANT_OPTS -Dbuild.optimize=off"
fi

# add all JAR files in JAVA_LIBS to CLASSPATH
SYSTEMCP=`echo $JAVA_LIBS/*.jar | tr ' ' ':'`

# add all JAR files in the project libraries directory to CLASSPATH
PROJECTCP=`echo $BINDIR/../lib/*.jar | tr ' ' ':'`

# also the project jar file
PROJECTJAR=`echo $BINDIR/../dist/*.jar`

if [ "$CLASSPATH" ] ; then
    CLASSPATH="$PROJECTJAR:$PROJECTCP:$SYSTEMCP:$CLASSPATH"
else
    CLASSPATH="$PROJECTJAR:$PROJECTCP:$SYSTEMCP"
fi
export CLASSPATH

$JAVA_HOME/bin/java $ANT_OPTS -Dant.home=/usr/share/ant \
	org.apache.tools.ant.Main $@
