forked from microsoft/terminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
70 lines (63 loc) · 1.87 KB
/
build.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
@echo off
rem Add path to MSBuild Binaries
set MSBUILD=()
for /f "usebackq tokens=*" %%f in (`where.exe msbuild.exe 2^>nul`) do (
set MSBUILD="%%~ff"
goto :FOUND_MSBUILD
)
set AppFiles=%ProgramFiles(x86)%
if NOT %PROCESSOR_ARCHITECTURE%==AMD64 set AppFiles=%ProgramFiles%
set MSBUILD="%AppFiles%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
set MSBUILD="%AppFiles%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
set MSBUILD="%AppFiles%\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
set MSBUILD="%AppFiles%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
set MSBUILD="%AppFiles%\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
set MSBUILD="%AppFiles%\MSBuild\14.0\bin\msbuild.exe"
if exist %MSBUILD% (
goto :FOUND_MSBUILD
)
echo "MSBuild was not found. Make sure it is installed and included in the search path."
goto :EXIT
:FOUND_MSBUILD
echo MSBuild was found at %MSBUILD%
echo.
set _MSBUILD_TARGET=Build
set _MSBUILD_CONFIG=Debug
:ARGS_LOOP
if (%1) == () goto :POST_ARGS_LOOP
if (%1) == (clean) (
set _MSBUILD_TARGET=Clean,Build
)
if (%1) == (rel) (
set _MSBUILD_CONFIG=Release
)
shift
goto :ARGS_LOOP
:POST_ARGS_LOOP
%MSBUILD% %~dp0ColorTool.sln /t:%_MSBUILD_TARGET% /m /nr:true /p:Configuration=%_MSBUILD_CONFIG% /p:OutputPath=.\bin\%_MSBUILD_CONFIG%\
if (%ERRORLEVEL%) == (0) (
echo.
echo Created exe in:
echo %~dp0ColorTool\bin\%_MSBUILD_CONFIG%\ColorTool.exe
echo.
echo Copying exe to root of project...
copy %~dp0ColorTool\bin\%_MSBUILD_CONFIG%\colortool.exe %~dp0ColorTool.exe
echo.
)
:EXIT
Pause