-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.cmd
73 lines (53 loc) · 2.18 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@echo off
cd /d "%~dp0"
if "%PANDOC%"=="" (
set "PANDOC=C:\Program Files\Pandoc\pandoc.exe"
)
if "%VS2019INSTALLDIR%"=="" (
set "VS2019INSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional"
)
if not exist "%PANDOC%" (
echo Error: PANDOC executable not found!
goto:finished
)
if not exist "%VS2019INSTALLDIR%\Common7\Tools\VsDevCmd.bat" (
echo Error: VS2019INSTALLDIR not found!
goto:finished
)
call "%VS2019INSTALLDIR%\Common7\Tools\VsDevCmd.bat" -no_logo
echo ------------------------------------------------------------------------------
echo Clean up...
echo ------------------------------------------------------------------------------
for %%d in (bin obj out packages) do (
echo %%~d
if exist %%~d\. rmdir /S /Q %%~d
)
for /F "tokens=* usebackq" %%i in (`start /B /WAIT "date" "%CD%\etc\utilities\unxutils\date.exe" "+%%Y-%%m-%%d"`) do (
set "BUILD_DATE=%%~i"
)
echo ------------------------------------------------------------------------------
echo Build application...
echo ------------------------------------------------------------------------------
MSBuild /t:Restore /p:Configuration=Release /p:Platform="Any CPU" "%CD%\CertViewer.sln"
if %ERRORLEVEL% neq 0 goto:finished
MSBuild /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU" /p:EnableCosturaFody="true" "%CD%\CertViewer.sln"
if %ERRORLEVEL% neq 0 goto:finished
echo ------------------------------------------------------------------------------
echo Create bundles...
echo ------------------------------------------------------------------------------
mkdir "out\target"
copy /B "bin\Release\CertViewer.exe*" "out\target"
copy /B "LICENSE.txt" "out\target"
"%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"
attrib +R "out\target\*.*"
set "ZIP_EXEFILE=%CD%\etc\utilities\info-zip\zip.exe"
set "ZIP_OUTFILE=%CD%\out\CertViewer.%BUILD_DATE%.zip"
pushd "out\target"
"%ZIP_EXEFILE%" -z -r -9 "%ZIP_OUTFILE%" *.* < "%CD%\LICENSE.txt"
popd
attrib +R "out\CertViewer.%BUILD_DATE%.zip"
echo.
echo Completed.
echo.
:finished
pause