forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.cmd
42 lines (33 loc) · 1.61 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
@echo off
setlocal
:: Check prerequisites
if not "%VisualStudioVersion%" == "14.0" (
echo Error: build.cmd should be run from a Visual Studio 2015 Command Prompt.
echo Please see https://github.com/Microsoft/msbuild/wiki/Building-Testing-and-Debugging for build instructions.
exit /b 1
)
:: Check for a custom MSBuild path. If not defined, default to the one in your path.
if not defined MSBUILDCUSTOMPATH (
set MSBUILDCUSTOMPATH=MSBuild.exe
)
set NUGETEXEPATH="%~dp0packages\NuGet.exe"
if not exist "%~dp0packages" mkdir "%~dp0packages"
if not exist "%NUGETEXEPATH%" (
:: This will need to be fixed for non-windows
echo ** Downloading NuGet.exe from https://nuget.org/NuGet.exe...
echo PS^> Invoke-WebRequest -OutFile %NUGETEXEPATH% "https://nuget.org/NuGet.exe"
powershell -Command "Invoke-WebRequest -OutFile %NUGETEXEPATH% "https://nuget.org/NuGet.exe""
)
echo Restoring NuGet packages
"%NUGETEXEPATH%" install "%~dp0src\.nuget\packages.config" -o "%~dp0packages"
echo ** MSBuild Path: %MSBUILDCUSTOMPATH%
echo ** Building all sources
:: Call MSBuild
echo ** "%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
"%MSBUILDCUSTOMPATH%" "%~dp0build.proj" /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log" %*
set BUILDERRORLEVEL=%ERRORLEVEL%
echo.
:: Pull the build summary from the log file
findstr /ir /c:".*Warning(s)" /c:".*Error(s)" /c:"Time Elapsed.*" "%~dp0msbuild.log"
echo ** Build completed. Exit code: %BUILDERRORLEVEL%
exit /b %BUILDERRORLEVEL%