@rem Unrecognized arguments are added to the argument list as-is
set _args_=%_args_% %1
shift
goto :optchk
:aftshift
goto aftsets
@rem Process command line options
:sjars
shift
set JARS_DIR=%1
shift
goto optchk
:sjava
shift
set JAVA_DIR=%1
shift
goto optchk
:aftsets
@rem Set up a minimal CLASSPATH if we don't have one but were given a JAVA_DIR
if NOT "%CLASSPATH%" == "" goto cwd
if "%JAVA_DIR%" == "" goto usage
set CLASSPATH="%JAVA_DIR%\lib\classes.zip;."
:cwd
@rem Verify the current directory is where tbuilder.bat is
if exist .\tbuilder.bat goto aftcwd
echo This batch file must be run from the current directory.
goto ropend
:aftcwd
:setdflts
@rem add the argument that tells the template builder where it's properties file is
if "%JARS_DIR%" == "" set JARS_DIR=..\jars\
if NOT "%JAVA_DIR%" == "" set JAVA_VM_DIR=%JAVA_DIR%\bin\
@rem run out of the known jar files ONLY
if "%TB_CP%"== "" goto :usejars
@rem use current directory
set TB_TYPE=current directory
set TB_CP="%CLASSPATH%;."
echo usecwd - %TB_CP%
goto :doit
:usejars
set TB_TYPE=JARS
set TB_CP="%CLASSPATH%;%JARS_DIR%devpack_chart_app.jar;%JARS_DIR%devpack_graphics_app.jar;%JARS_DIR%devpack_scheduler_app.jar;%JARS_DIR%devpack_sheet_app.jar;%JARS_DIR%devpack_wp_app.jar"
goto :doit
:doit
@rem Temporarily unset the CLASSPATH
set CLASSPATH=
@rem if JAVA_DIR is not set, java must be found on the path
@rem USE JDK's java
echo Using %JAVA_VM_DIR%java, classes from %TB_TYPE%