#!/bin/sh -
#
# build script for 1.5
#
# If it's given a buildname it creates a subdirectory and places a build in it,
# otherwise it just creates the docs and class files.
#

JDKPATH=/opt/jdk1.5.0   # JDK 1.5 location
JAVA_MAIL_HOME=/opt/javamail-1.3.1
JAVA_ACTIVATION_HOME=/opt/jaf-1.0.2

JAVA_HOME=$JDKPATH
export JAVA_HOME

PATH=$JDKPATH/bin:$PATH
export PATH

CLASSPATH=$JAVA_MAIL_HOME/mail.jar:$JAVA_ACTIVATION_HOME/activation.jar:$CLASSPATH
export CLASSPATH

if [ "$1" == "test" ]
then
    ant -f jdk15.xml test
else
    if [ "`echo $CLASSPATH | grep checkstyle`" != "" ]
    then
        ant -Dcheckstyle.on=true -f jdk15.xml build-provider 
        ant -f jdk15.xml build
    else
        ant -f jdk15.xml build-provider
        ant -f jdk15.xml build
    fi
fi

