diff options
author | Nick Guerrera <nicholg@microsoft.com> | 2015-01-30 04:35:42 +0300 |
---|---|---|
committer | Nick Guerrera <nicholg@microsoft.com> | 2015-01-30 04:52:11 +0300 |
commit | edc608ad9e26ef80b34c10227dd903f2b046c956 (patch) | |
tree | 1063769a8aaa7f6c093d3739873f022d1f758600 /build.cmd | |
parent | 32053c83f38e92327e7ba4a03a9900278fc995eb (diff) |
Use msbuild on path after verifying VS command prompt
Check for either VS 2013 or VS 2015 developer command prompt
and use whatever msbuild.exe they provide. The probing logic
before would prefer msbuild 12 over 14 even in a VS 2015
environment. This was confusing and meant different process
andresults between build and msbuild in a VS 2015 command
prompt on a machine with both versions of VS installed.
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -7,13 +7,13 @@ setlocal :: assembly. :: Check prerequisites -set _msbuildexe="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe" -if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\12.0\Bin\MSBuild.exe" -if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe" -if not exist %_msbuildexe% set _msbuildexe="%ProgramFiles%\MSBuild\14.0\Bin\MSBuild.exe" -if not exist %_msbuildexe% echo Error: Could not find MSBuild.exe. Please see https://github.com/dotnet/corefx/wiki/Developer%%20Guide for build instructions. && exit /b 1 - -if not defined VSINSTALLDIR echo Error: build.cmd should be run from a Visual Studio Command Prompt. Please see https://github.com/dotnet/corefx/wiki/Developer%%20Guide for build instructions. && exit /b 1 +if not defined VS120COMNTOOLS ( + if not defined VS140COMNTOOLS ( + echo Error: build.cmd should be run from a Visual Studio 2013 or 2015 Command Prompt. + echo Please see https://github.com/dotnet/corefx/wiki/Developer%%20Guide for build instructions. + exit /b 1 + ) +) :: Log build command line set _buildprefix=echo @@ -28,7 +28,7 @@ call :build %* goto :AfterBuild :build -%_buildprefix% %_msbuildexe% "%~dp0build.proj" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log";Append %* %_buildpostfix% +%_buildprefix% msbuild "%~dp0build.proj" /nologo /maxcpucount /verbosity:minimal /nodeReuse:false /fileloggerparameters:Verbosity=diag;LogFile="%~dp0msbuild.log";Append %* %_buildpostfix% set BUILDERRORLEVEL=%ERRORLEVEL% goto :eof |