This repository has been archived by the owner on Oct 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.bat
65 lines (55 loc) · 2.48 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
@echo off
:checkMsBuild
if exist "%msbuild%" goto checkNuget
set msbuild=
for %%a in (MSBuild.exe) do (set msbuild=%%~$PATH:a)
if exist %msbuild% goto checkNuget
rem Visual Studio Build Tools 2019
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem VS2019
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem Visual Studio Build Tools 2017
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem VS2017
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
set msbuild=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem VS2015, 2013, cf.: http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx
set msbuild=c:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem VS2013
set msbuild=c:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
if exist "%msbuild%" goto checkNuget
rem .NET Framework
for /D %%a in (%SYSTEMROOT%\Microsoft.NET\Framework\v4.0*) do set "msbuild=%%a\MSBuild.exe"
if exist "%msbuild%" goto checkNuget
echo error: can't find MSBuild.exe. Is .NET Framework installed?
exit /B 2
:checkNuget
for %%a in (NuGet.exe) do (set nugetPath=%%~$PATH:a)
if not defined nugetPath (
echo error: can't find NuGet.exe in your path.
exit /B 3
)
:setDefaults
if not defined Configuration set Configuration=Release
if not defined EnableNuGetPackageRestore set EnableNuGetPackageRestore=true
set solutionDir=%~dp0%
if not "%cd%\"=="%solutionDir%" (
echo change to directory "%solutionDir%"
cd /d "%solutionDir%"
)
:packageRestore
NuGet.exe restore -source "%PackageSources%"
:build
"%msbuild%" %* /p:CustomBeforeMicrosoftCommonTargets="%solutionDir%empty.targets"