#!/bin/sh

# $Id: build.sh,v 1.4 2005/05/17 14:00:25 wguttmn Exp $

if [ -z "$JAVA_HOME" ] ; then
  JAVA=`which java`
  if [ -z "$JAVA" ] ; then
    echo "Cannot find JAVA. Please set your PATH."
    exit 1
  fi
  JAVA_BIN=`dirname $JAVA`
  JAVA_HOME=$JAVA_BIN/..
fi

JAVA=$JAVA_HOME/bin/java

CLASSPATH=lib/ant-1.6.jar:lib/ant-1.6-launcher.jar:lib/xerces-J_1.4.0.jar:build/classes/:$CLASSPATH:$JAVA_HOME/lib/tools.jar

for i in `ls ./lib/*.jar`
   do 
       CLASSPATH=$CLASSPATH:$i
   done

$JAVA -classpath $CLASSPATH -Dant.home=lib org.apache.tools.ant.Main "$@" -buildfile src/build.xml
