Permalink
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 1.29 KB
@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