forked from NuGetPackageExplorer/NuGetPackageExplorer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.cmd
More file actions
33 lines (26 loc) · 1.29 KB
/
build.cmd
File metadata and controls
33 lines (26 loc) · 1.29 KB
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
@echo Off
setlocal enableextensions enabledelayedexpansion
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
FOR /F "delims=" %%E in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\installer\vswhere.exe" -latest -property installationPath') DO (
set "MSBUILD_EXE=%%E\MSBuild\15.0\Bin\MSBuild.exe"
if exist "!MSBUILD_EXE!" goto :build
)
)
FOR %%E in (Enterprise, Professional, Community) DO (
set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\%%E\MSBuild\15.0\Bin\MSBuild.exe"
if exist "!MSBUILD_EXE!" goto :build
)
REM Couldn't be located in the standard locations, expand search
FOR /F "delims=" %%E IN ('dir /b /ad "%ProgramFiles(x86)%\Microsoft Visual Studio\"') DO (
set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\%%E\MSBuild\15.0\Bin\MSBuild.exe"
if exist "!MSBUILD_EXE!" goto :build
FOR /F "delims=" %%F IN ('dir /b /ad "%ProgramFiles(x86)%\Microsoft Visual Studio\%%E"') DO (
set "MSBUILD_EXE=%ProgramFiles(x86)%\Microsoft Visual Studio\%%E\%%F\MSBuild\15.0\Bin\MSBuild.exe"
if exist "!MSBUILD_EXE!" goto :build
)
)
echo Could not find MSBuild 15, it is required to build.
exit /b 1
:build
"%MSBUILD_EXE%" NuGetPackageExplorer.sln /t:Restore
"%MSBUILD_EXE%" NuGetPackageExplorer.sln /m /bl /verbosity:minimal /p:Configuration=Release