-
Notifications
You must be signed in to change notification settings - Fork 101
/
build.cmd
52 lines (44 loc) · 1.13 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
@echo off
setlocal
:: Parse the arguments
IF "%1"=="/?" ( GOTO :help )
IF "%1"=="help" ( GOTO :help )
:parse
IF NOT "%1"=="" (
IF /I "%1"=="/Version" (
SET VersionArg=/p:Version=%2
) ELSE IF /I "%1"=="/Configuration" (
SET ConfigArg=/p:Configuration=%2
) ELSE (
SET TargetArg=/t:%1
SHIFT
GOTO :parse
)
)
:: Load the environment of the most recent version of Visual Studio installed
if not defined VisualStudioVersion (
if defined VS150COMNTOOLS (
call "%VS150COMNTOOLS%\VsDevCmd.bat"
goto :build
)
if defined VS140COMNTOOLS (
call "%VS140COMNTOOLS%\VsDevCmd.bat"
goto :build
)
if defined VS120COMNTOOLS (
call "%VS120COMNTOOLS%\VsDevCmd.bat"
goto :build
)
echo Error: build.cmd requires Visual Studio 2013 or 2015.
exit /b 1
)
:build
msbuild build\build.proj %TargetArg% %ConfigArg% %VersionArg% /nologo
exit /b %ERRORLEVEL%
:help
echo build.cmd [Build^|UnitTest^|IntegrationTest^|Documentation^|Package] [/Configuration Debug^|Release]
echo.
echo Examples:
echo build.cmd
echo build.cmd UnitTest
echo build.cmd Package /Configuration Release