-
Notifications
You must be signed in to change notification settings - Fork 5
/
7-build-app.bat
88 lines (65 loc) · 2.66 KB
/
7-build-app.bat
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@echo off
@setlocal enableextensions
@cd /d "%~dp0"
echo Delete and Create the "release" folder and its contents
rd /S /Q "release"
mkdir release
echo Delete the "docs" folder and its contents
rd /S /Q "docs/coverxygen"
rd /S /Q "docs/coveragereport"
rd /S /Q "docs/doxygen"
mkdir docs
cd docs
mkdir coverxygen
mkdir coveragereport
mkdir doxygen
cd ..
echo Delete the "site" folder and its contents
rd /S /Q "site"
mkdir site
echo Folders are Recreated successfully.
echo Generate Documentation
call doxygen Doxyfile
echo Run Coverxygen
call python -m coverxygen --xml-dir ./docs/doxygen/xml --src-dir ./ --format lcov --output ./docs/coverxygen/lcov.info --prefix %currentDir%\
echo Run lcov genhtml
call perl C:\ProgramData\chocolatey\lib\lcov\tools\bin\genhtml --legend --title "Documentation Coverage Report" ./docs/coverxygen/lcov.info -o docs/coverxygen
echo Testing Application with Coverage
cd CalculatorLibrary.Tests
call dotnet restore
call dotnet add package coverlet.msbuild
call dotnet build --configuration Release
call dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --results-directory:./TestResults --logger:trx
echo Generate Test Report
cd ..
call reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:docs/coveragereport" -reporttypes:Html
call reportgenerator "-reports:**/coverage.cobertura.xml" "-targetdir:assets" -reporttypes:Badges
echo Copy the "assets" folder and its contents to "docs" recursively
call robocopy assets "docs\assets" /E
echo Copy the "README.md" file to "docs\index.md"
call copy README.md "docs\index.md"
echo Files and folders copied successfully.
echo Generate Webpage
call mkdocs build
echo Publish Linux Binaries
call dotnet publish -c Release -r linux-x64 --self-contained true -o publish/linux
echo Publish MacOS Binaries
call dotnet publish -c Release -r osx-x64 --self-contained true -o publish/macos
echo Publish Windows Binaries
call dotnet publish -c Release -r win-x64 --self-contained true -o publish/windows
echo Package Linux Binaries
call tar -czvf release/linux-binaries.tar.gz -C publish/linux .
echo Package MacOS Binaries
call tar -czvf release/macos-binaries.tar.gz -C publish/macos .
echo Package Windows Binaries
call tar -czvf release/windows-binaries.tar.gz -C publish/windows .
echo Package Test Coverage Report
tar -czvf release/test-coverage-report.tar.gz -C docs/coveragereport .
echo Package Doc Coverage Report
tar -czvf release/doc-coverage-report.tar.gz -C docs/coverxygen .
echo Package Code Documentation
tar -czvf release/doxygen-documentation.tar.gz -C docs/doxygen .
echo ....................
echo Operation Completed!
echo Press Any Key to Continue...
pause