This repository has been archived by the owner on Jan 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.bat
57 lines (48 loc) · 1.98 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
@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 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
echo ==========================================
echo %msbuild%
echo ==========================================
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"