@ECHO OFF
REM -- This is a wrapper to BUILD2.CMD that runs a copy of CMD.EXE with
REM -- command extensions and delayed environment variable expansion enabled.
REM -- We need the latter for building the CLASSPATH in a for loop.
REM
REM Execute HELP CMD at a command prompt to read more.

REM -- Sanity checks
IF NOT EXIST BUILD2.CMD GOTO WRONG_DIRECTORY
IF NOT EXIST LIB GOTO LIB_NOT_INSTALLED

CMD /V:ON /C BUILD2.CMD %*

GOTO EXIT

:WRONG_DIRECTORY
 ECHO ERROR: Could not find BUILD2.CMD
 ECHO        Make sure you are in the correct directory before calling BUILD.CMD
 ECHO        If you ran this from Explorer, please try using the command line.
GOTO EXIT

:LIB_NOT_INSTALLED
 ECHO ERROR: Could not find the ANT library
 ECHO        The files needed to run ANT are not distributed with the documentation.
 ECHO        Please install the files first.
GOTO EXIT


:EXIT
