#!/bin/sh

ANT_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=512m"

#
# setup to use bundled of ant
#

bundledAntIs=1

if test -d ../apache-ant
then
    ANT_HOME=../apache-ant
elif test -d ../../apache-ant
then
    ANT_HOME=../../apache-ant
else
    echo "INFO: No bundled ant found (../apache-ant or ../../apache-ant). Using existing ant"
    ANT_RUN=ant
    bundledAntIs=0
fi

if [ "$bundledAntIs" -eq "1" ];
then
    export ANT_HOME
    ANT_RUN=$ANT_HOME/bin/ant
    export ANT_RUN
    PATH=$ANT_HOME/bin:$PATH
    export PATH
fi

#
# Collect the command line args
#

CMD_LINE_ARGS=$*

$ANT_RUN --noconfig -nouserlib -f build.xml $CMD_LINE_ARGS

