-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
84 lines (66 loc) · 1.19 KB
/
build.bat
File metadata and controls
84 lines (66 loc) · 1.19 KB
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
@echo off
set msbuildcfg=msbuild.cfg
set MSBUILD_PATH=
set havedotnet=
set havemsbuild=
set anyfound=
if exist %msbuildcfg% (
for /f "usebackq delims=" %%x in (%msbuildcfg%) do (set "%%x")
)
if defined MSBUILD_PATH (
if exist %MSBUILD_PATH% (
set havemsbuild=12
set anyfound=1
)
)
where /Q dotnet.exe && (
set havedotnet=34
set anyfound=1
)
if not "%anyfound%"=="1" (
echo Neither MSBuild nor dotnet build found.
echo=
pause
exit /b 1
)
echo 1. Debug Build
echo 2. Release Build
choice /c 12 /m "Select build config: "
if errorlevel 2 (
goto release
)
if errorlevel 1 (
goto debug
)
:release
set CONFIG=Release
goto config_end
:debug
set CONFIG=Debug
goto config_end
:config_end
echo Building Config %CONFIG%
timeout /t 1
if defined havemsbuild (
if not defined havedotnet goto build_msbuild
)
if defined havedotnet (
if not defined havemsbuild goto build_dotnet
)
echo 1. dotnet
echo 2. MSBuild
choice /c 12 /m "Select build system: "
if errorlevel 2 (
goto build_msbuild
)
if errorlevel 1 (
goto build_dotnet
)
:build_msbuild
%MSBUILD_PATH% /p:Configuration=%CONFIG%
goto end
:build_dotnet
dotnet build -c %CONFIG%
goto end
:end
pause