diff options
author | Matt Ellis <matell@microsoft.com> | 2015-02-17 01:35:43 +0300 |
---|---|---|
committer | Matt Ellis <matell@microsoft.com> | 2015-02-17 03:04:53 +0300 |
commit | a64edfd54de9f32c9677df15ef45b1093fb005de (patch) | |
tree | 8128853df5018ca678672773a326311036fa8482 /build.cmd | |
parent | 0f8ecb9393a0e86157e7c8744a76f74ad654dce9 (diff) |
Allow running build.cmd from a "clean" window
Previouly, build.cmd had to be run from a "Developer Command Prompt"
window in order to find msbuild. This change removes that
requirement. If you are not in a Developer Command Promprt, we try to
load one for VS 2015 or VS 2013 (in that order) for the invocation of
build.cmd
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -6,15 +6,24 @@ setlocal :: means that that rebuilding cannot successfully delete the task :: assembly. -:: Check prerequisites -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-Guide for build instructions. - exit /b 1 +if not defined VisualStudioVersion ( + if defined VS140COMNTOOLS ( + call "%VS140COMNTOOLS%\VsDevCmd.bat" + goto :EnvSet ) + + if defined VS120COMNTOOLS ( + call "%VS120COMNTOOLS%\VsDevCmd.bat" + goto :EnvSet + ) + + echo Error: build.cmd requires Visual Studio 2013 or 2015. + echo Please see https://github.com/dotnet/corefx/wiki/Developer-Guide for build instructions. + exit /b 1 ) +:EnvSet + :: Log build command line set _buildproj=%~dp0build.proj set _buildlog=%~dp0msbuild.log |