::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Builds all code base.
:: Usage:
:: build - incremental build without building MVC views
:: build views - incremental build with MVC views, to catch runtime errors
:: build clean - clean build without building MVC views
:: build clean views - clean build with MVC views
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@ECHO OFF
SETLOCAL
CALL "%VS90COMNTOOLS%\VSVars32.bat"
IF NOT _%1==_clean GOTO INCREMENTED
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 'clean' was specified - remove all compiled code
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
msbuild YourSolution.sln /t:Clean /p:Configuration=Debug /p:BuildConfiguration=Debug
SHIFT
:INCREMENTED
IF NOT _%1==_views GOTO BUILD
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 'views' was specified - build code and MVC views
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
msbuild YourSolution.sln /t:Build /p:Configuration=Debug /p:BuildConfiguration=Debug /p:MvcBuildViews=true
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
GOTO TESTS
:BUILD
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: 'views' not specified - build code only
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
msbuild YourSolution.sln /t:Build /p:Configuration=Debug /p:BuildConfiguration=Debug
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
:TESTS
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Build passed ok, now run the tests
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
CALL RunTests.bat console
ENDLOCAL
GOTO :EOF
:ERROR
ENDLOCAL
ECHO.
ECHO :::::::::::::::::::::::::::::::::::::::::::::
ECHO :: Uh oh, errors during the build. ::
ECHO :::::::::::::::::::::::::::::::::::::::::::::
PAUSE
@ECHO OFF
IF _%1 == _console GOTO CONSOLE
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Kick off GUI test runner
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
nunit.exe %~n0.nunit /noload
GOTO :EOF
:CONSOLE
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Kick off console test runner
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
nunit-console.exe %~n0.nunit /nologo /noshadow