@echo off
setlocal

call clean.bat
IF errorlevel 1 GOTO :eof

for %%I in ("%VSS_CC_PATH%\..") do set "VSS_CC_PARENT=%%~fI"
for %%f in (%VSS_CC_PATH%) do set foldername=%%~nxf

del /F /Q %VSS_CC_PARENT%\%foldername%.zip

rd /S /Q %VSS_CC_PATH%\deploy\wildfly\standalone\data
rd /S /Q %VSS_CC_PATH%\deploy\wildfly\standalone\deployments
rd /S /Q %VSS_CC_PATH%\deploy\wildfly\standalone\log
rd /S /Q %VSS_CC_PATH%\deploy\wildfly\standalone\tmp

7z a ^
-r %VSS_CC_PARENT%\%foldername%.zip %VSS_CC_PATH% ^
-xr!*.fpr ^
-xr!*.log ^
-xr!target ^
-xr!target-eclipse

echo Zip file %VSS_CC_PARENT%\%foldername%.zip created.
