Updated copyright year.
[certviewer.git] / build.cmd
blob01e526effdf7050d16c48b618fd9896d4340eba2
1 @echo off
2 cd /d "%~dp0"
4 set "PANDOC=C:\Program Files\Pandoc\pandoc.exe"
6 if not exist "%VS2019INSTALLDIR%\Common7\Tools\VsDevCmd.bat" (
7 echo Error: VS2019INSTALLDIR not found!
8 goto:finished
11 call "%VS2019INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -no_logo
13 echo ------------------------------------------------------------------------------
14 echo Clean up...
15 echo ------------------------------------------------------------------------------
17 for %%d in (bin obj out packages) do (
18 echo %%~d
19 if exist %%~d\. rmdir /S /Q %%~d
22 for /F "tokens=* usebackq" %%i in (`start /B /WAIT "date" "%CD%\etc\utilities\unxutils\date.exe" "+%%Y-%%m-%%d"`) do (
23 set "BUILD_DATE=%%~i"
26 echo ------------------------------------------------------------------------------
27 echo Build application...
28 echo ------------------------------------------------------------------------------
30 MSBuild /t:Restore /p:Configuration=Release /p:Platform="Any CPU" "%CD%\CertViewer.sln"
31 if %ERRORLEVEL% neq 0 goto:finished
33 MSBuild /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" /p:EnableCosturaFody="true" "%CD%\CertViewer.sln"
34 if %ERRORLEVEL% neq 0 goto:finished
36 echo ------------------------------------------------------------------------------
37 echo Create bundles...
38 echo ------------------------------------------------------------------------------
40 mkdir "out\target"
42 copy /B "bin\Release\CertViewer.exe*" "out\target"
43 copy /B "LICENSE.txt" "out\target"
45 "%CD%\etc\utilities\unxutils\grep.exe" -v "shields.io" "README.md" | "%PANDOC%" -f markdown -t html5 --metadata pagetitle="CertViewer" --embed-resources --standalone --css "etc\style\github-markdown.css" -o "out\target\README.html"
47 attrib +R "out\target\*.*"
49 set "ZIP_EXEFILE=%CD%\etc\utilities\info-zip\zip.exe"
50 set "ZIP_OUTFILE=%CD%\out\CertViewer.%BUILD_DATE%.zip"
51 pushd "out\target"
52 "%ZIP_EXEFILE%" -z -r -9 "%ZIP_OUTFILE%" *.* < "%CD%\LICENSE.txt"
53 popd
55 attrib +R "out\CertViewer.%BUILD_DATE%.zip"
57 echo.
58 echo Completed.
59 echo.
61 :finished
62 pause