#!/bin/bash
export JAVA_HOME=$(sed -ne '/JDKHome/{s/.*<JDKHome>\(.*\)<\/JDKHome>.*/\1/p;q;}' settings.xml)
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/rt.jar
export PATH=$JAVA_HOME/bin:${PATH}
# Do not combine clean and summary targets in single ant call;
# it leads to errors every other run.
tools/apache-ant-1.9.4/bin/ant clean summary
if [ -z "$1" ]
then
    tools/apache-ant-1.9.4/bin/ant summary
else
    tools/apache-ant-1.9.4/bin/ant -DinputDir="$1" summary
fi

