REM masterCIPRES.bat REM REM Run this script from top level build directory (the one that REM contains winCIPRES). This directory must also contain REM a directory named msvc_dlls\bin that has the msvc dlls REM we need to redistribute. REM REM This .bat file uses some UNIX utilities. I (terri) use the REM mks toolkit and OpenSSH. REM set CIPRES_VER=1.0.1 set EXTRAS_DIR=%CD%\msvc_dlls set MC_ORIG_DIR=%CD% set BINARY_DIST=%MC_ORIG_DIR%\CIPRES-win32.zip @echo Build started at %TIME% %DATE% REM Expand the template for winCIPRES directory structure REM Note that we're not downloading the template each time this REM is run. REM rd /S /Q winCIPRES jar xf winCIPRES_template.zip if errorlevel 1 goto error REM Make sure we're using the latest makeCIPRES.bat, not the one from the template. REM chdir winCIPRES copy /Y ..\makeCIPRES.bat . copy /Y ..\windowsBuildInstructions.txt . REM Note that both of the source archives have the .svn and CVS directories REM as well as source code. REM REM call makeCIPRES.bat -n -p -nc -nb REM if errorlevel 1 goto error chdir .. REM Create an archive that developers can download to build from src. REM This is identical to winCIPRES_template.zip except that it may have REM a more uptodate makeCIPRES.bat and windowsBuildInstructions.txt. jar cf winCIPRES_src.zip winCIPRES REM Now update the cipres source and build REM cd winCIPRES call makeCIPRES.bat -n if errorlevel 1 goto error REM Make the binary distribution CIPRES-win32.zip REM chdir CIPRES-%CIPRES_VER%\cipres call ant -Dextras_dir=%EXTRAS_DIR% -Dzipfile=%BINARY_DIST% dist if errorlevel 1 goto error REM ant turns echo off, for debugging we want it on. echo on :test REM Test the build set TEST_FAILED=0 chdir winCIPRES\CIPRES-%CIPRES_VER%\cipres call ant reconfigure if errorlevel 1 goto error echo on call ant junit-test if errorlevel 1 set TEST_FAILED=1 echo on REM Remove old test report and upload new one ssh %USER%@%WEBSERVER% rm -rf %WEBDIR%/test_results/Win32 scp -r cipresapp/java/test/results/report %USER%@%WEBSERVER%:%WEBDIR%/test_results/Win32 ssh %USER%@%WEBSERVER% chmod -R 775 %WEBDIR%/test_results/Win32 ssh %USER%@%WEBSERVER% chgrp -R tol %WEBDIR%/test_results/Win32 REM Upload the binary dist and the source archive REM (Actually, don't upload binary if junit test failed) chdir ..\..\.. scp winCIPRES_src.zip %USER%@%WEBSERVER%:%WEBDIR% if "%TEST_FAILED%" == "1" goto skip scp CIPRES-Win32.zip %USER%@%WEBSERVER%:%WEBDIR% :skip scp WindowsNightlyBuild.txt %USER%@%WEBSERVER%:%WEBDIR%/windows_build_tools ssh %USER%@%WEBSERVER% chgrp tol %WEBDIR%/CIPRES-Win32.zip %WEBDIR%/winCIPRES_src.zip %WEBDIR%/windows_build_tools/WindowsNightlyBuild.txt ssh %USER%@%WEBSERVER% chmod 775 %WEBDIR%/CIPRES-Win32.zip %WEBDIR%/winCIPRES_src.zip ssh %USER%@%WEBSERVER% chmod 664 %WEBDIR%/windows_build_tools/WindowsNightlyBuild.txt if errorlevel 1 goto error if "%TEST_FAILED%" == "0" goto ok echo "JUNIT Test Failed" goto error :error @echo masterCIPRES.bat had an error! chdir %MC_ORIG_DIR% @echo Build finished at %TIME% %DATE% exit /b 1 :ok @echo masterCIPRES.bat built and uploaded a new distribution. chdir %MC_ORIG_DIR% @echo Build finished at %TIME% %DATE%