-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.cmd
29 lines (24 loc) · 1.03 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
@ECHO OFF
Set ProductName=SccmTools
IF EXIST "%VSDEVCMD%" goto Build
IF EXIST "%MSBUILDPATH%" goto Build
:VSEnv
Set VSDEVCMD=%VS140COMNTOOLS%VsDevCmd.bat
Echo Checking to see if Visual Studio 2015 is installed ("%VS140COMNTOOLS%")
IF NOT EXIST "%VSDEVCMD%" set BuildMessage="Visual Studio 2015 do not seem to be installed, trying MSBuild instead..." & goto MSBuildEnv
Echo Preparing build environment...
call "%VSDEVCMD%"
:MSBuildEnv
Set MSBUILDPATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin
Echo Checking to see if MSBuild is installed ("%MSBUILDPATH%")
IF NOT EXIST "%MSBUILDPATH%" set BuildMessage="Neither Visual Studio 2015 or MSBuild seem to be installed. Terminating." & goto end
Set Path=%Path%;%MSBUILDPATH%
:Build
Echo Building %ProductName%...
nuget.exe restore %ProductName%.sln
msbuild.exe %ProductName%.build %1 %2 %3 %4 %5 %6 %7 %8 %9
Set BuildErrorLevel=%ERRORLEVEL%
IF %BuildErrorLevel%==0 Set BuildMessage=Sucessfully build %ProductName%
IF NOT %BuildErrorLevel% == 0 Set BuildMessage=Failed to build %ProductName%
:End
Echo %BuildMessage%