#
# Revision: 31 1.2 build/cleanupApiDocs.ksh, build, xml4j2, xml4j2_0_15 
#

echo "Cleaning up generated API Documentation..."

#
# Define the environment variables pointing to relevant directories.
#

. setupEnvVars.ksh

#
# Test to see if required environment variables have been set or not.
# Its fatal if any of them are not set, so we exit.
#
# The following variables should be set:
#     XML4JAPIDOCDIR
#

errFlg=0

if test ! -n "$XML4JAPIDOCDIR"
then
    echo "Build Error: Environment variable XML4JAPIDOCDIR is not set."
    errFlg=1
else
    echo "XML4JAPIDOCDIR=$XML4JAPIDOCDIR"
fi

if test ! -n "$XML4JTXAPIDOCDIR"
then
    echo "Build Error: Environment variable XML4JTXAPIDOCDIR is not set."
    errFlg=1
else
    echo "XML4JTXAPIDOCDIR=$XML4JTXAPIDOCDIR"
fi

if test $errFlg -eq 1
then
    echo "Aborting..."
    exit
fi


APIDOCDIR=$XML4JAPIDOCDIR
TXAPIDOCDIR=$XML4JTXAPIDOCDIR

#
# Create the API documentation output directory if required.
#

if test -d $APIDOCDIR
then
    rm -rf $APIDOCDIR
fi

if test -d $TXAPIDOCDIR
then
    rm -rf $TXAPIDOCDIR
fi


echo "Finished cleaning up generated API Documentation"
