@echo off
echo Compiling checker...

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

rmdir /S /Q __tmp

echo Compiling validator...

rmdir /S /Q __tmp 2> nul
mkdir __tmp
javac -classpath "__check;%..\..\lib\validate4j.jar" -sourcepath . -d __tmp Validate.java src/SharedGeom.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 visulizer...

rmdir /S /Q __tmp 2> nul
mkdir __tmp
javac -sourcepath . -d __tmp src/Visualizer.java src/SharedGeom.java 
pushd __tmp
mkdir META-INF
echo Main-Class: Visualizer> META-INF/manifest.1
call jar cfm visulizer.jar META-INF/manifest.1 *.class
copy /Y visulizer.jar .. > nul
popd
rmdir /S /Q __tmp
