Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

Commit 8b5847b

Browse files
committed
Allow for falling back to msbuild 12 if msbuild 14 is not available (will build but not run)
1 parent 68004f5 commit 8b5847b

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

build.cmd

+14-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ SETLOCAL
44

55
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
66
SET SOLUTION_PATH=%~dp0src\CodeFormatter.sln
7-
SET BUILD_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
7+
SET MSBUILD14_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\14.0\bin\MSBuild.exe"
8+
SET MSBUILD12_TOOLS_PATH="%ProgramFiles(x86)%\MSBuild\12.0\bin\MSBuild.exe"
9+
SET BUILD_TOOLS_PATH=%MSBUILD14_TOOLS_PATH%
810

9-
IF NOT EXIST %BUILD_TOOLS_PATH% (
10-
echo In order to build or run this tool you need either Visual Studio 2015 or
11+
IF NOT EXIST %MSBUILD14_TOOLS_PATH% (
12+
echo In order to run this tool you need either Visual Studio 2015 or
1113
echo Microsoft Build Tools 2015 tools installed.
1214
echo.
1315
echo Visit this page to download either:
1416
echo.
1517
echo http://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs
1618
echo.
17-
goto :eof
19+
echo Attempting to fall back to MSBuild 12 for building only
20+
echo.
21+
IF NOT EXIST %MSBUILD12_TOOLS_PATH% (
22+
echo Could not find MSBuild 12. Please install build tools ^(See above^)
23+
exit /b 1
24+
) else (
25+
set BUILD_TOOLS_PATH=%MSBUILD12_TOOLS_PATH%
26+
)
1827
)
1928

2029
IF EXIST %CACHED_NUGET% goto restore
@@ -28,4 +37,4 @@ IF EXIST "%~dp0src\packages" goto build
2837

2938
:build
3039

31-
%BUILD_TOOLS_PATH% %SOLUTION_PATH% /p:OutDir="%~dp0bin " /nologo /m /v:m /flp:verbosity=normal %*
40+
%BUILD_TOOLS_PATH% %SOLUTION_PATH% /p:OutDir="%~dp0bin" /nologo /m /v:m /flp:verbosity=normal %*

0 commit comments

Comments
 (0)