@echo off

echo Compiling validator...

rmdir /S /Q __tmp 2> nul
mkdir __tmp
javac -classpath "__check;%..\..\lib\validate4j.jar" -sourcepath . -d __tmp Validate.java 
copy /Y ..\..\lib\validate4j.jar __tmp   > nul
pushd __tmp
call jar xf validate4j.jar
echo Main-Class: ru.ifmo.validate.ValidatorFramework> META-INF/manifest.1
echo Validate-Class: Validate>> META-INF/manifest.1
del /S /Q *.java > nul
del validate4j.jar > nul
call jar cfm validate.jar META-INF/manifest.1 *.class ru
copy /Y validate.jar .. > nul
popd
rmdir /S /Q __tmp

echo Compiling checker...
dcc32 -cc check.dpr