|
| 1 | +From 38b78fc594c2dcc709d1bb7577fd6579b33983e6 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Davis Goodin <dagood@microsoft.com> |
| 3 | +Date: Mon, 26 Nov 2018 18:42:05 -0600 |
| 4 | +Subject: [PATCH] Copy run.cmd changes from corefx |
| 5 | + |
| 6 | +This uses .NET Core msbuild, not desktop |
| 7 | +--- |
| 8 | + run.cmd | 52 +++++++++++++++++++++++++++++++++++++++++++++------- |
| 9 | + 1 file changed, 45 insertions(+), 7 deletions(-) |
| 10 | + |
| 11 | +diff --git a/run.cmd b/run.cmd |
| 12 | +index b12a0f7b..7a2fb135 100644 |
| 13 | +--- a/run.cmd |
| 14 | ++++ b/run.cmd |
| 15 | +@@ -1,6 +1,22 @@ |
| 16 | +-@if "%_echo%" neq "on" echo off |
| 17 | ++@if not defined _echo @echo off |
| 18 | + setlocal |
| 19 | + |
| 20 | ++:: Default to highest Visual Studio version available |
| 21 | ++:: |
| 22 | ++:: For VS2015 (and prior), only a single instance is allowed to be installed on a box |
| 23 | ++:: and VS140COMNTOOLS is set as a global environment variable by the installer. This |
| 24 | ++:: allows users to locate where the instance of VS2015 is installed. |
| 25 | ++:: |
| 26 | ++:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS |
| 27 | ++:: is no longer set as a global environment variable and is instead only set if the user |
| 28 | ++:: has launched the VS2017 Developer Command Prompt. |
| 29 | ++:: |
| 30 | ++:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is |
| 31 | ++:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and |
| 32 | ++:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015 |
| 33 | ++:: toolset if it is installed. Finally, we will fail the script if no supported VS instance |
| 34 | ++:: can be found. |
| 35 | ++ |
| 36 | + if defined VisualStudioVersion goto :Run |
| 37 | + |
| 38 | + set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" |
| 39 | +@@ -9,14 +25,36 @@ if exist %_VSWHERE% ( |
| 40 | + ) |
| 41 | + if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS% |
| 42 | + if not exist "%_VSCOMNTOOLS%" ( |
| 43 | +- echo Error: Visual Studio 2015 or 2017 required. |
| 44 | +- echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions. |
| 45 | +- exit /b 1 |
| 46 | ++ echo Error: Visual Studio 2015 or 2017 required. |
| 47 | ++ echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions. |
| 48 | ++ exit /b 1 |
| 49 | + ) |
| 50 | + |
| 51 | +-set VSCMD_START_DIR="%~dp0" |
| 52 | + call "%_VSCOMNTOOLS%\VsDevCmd.bat" |
| 53 | + |
| 54 | + :Run |
| 55 | +-powershell -NoProfile -ExecutionPolicy unrestricted -Command "%~dp0run.ps1 -- %*" |
| 56 | +-exit /b %ERRORLEVEL% |
| 57 | +\ No newline at end of file |
| 58 | ++:: Clear the 'Platform' env variable for this session, as it's a per-project setting within the build, and |
| 59 | ++:: misleading value (such as 'MCD' in HP PCs) may lead to build breakage (issue: #69). |
| 60 | ++set Platform= |
| 61 | ++ |
| 62 | ++:: Disable telemetry, first time experience, and global sdk look for the CLI |
| 63 | ++set DOTNET_CLI_TELEMETRY_OPTOUT=1 |
| 64 | ++set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 |
| 65 | ++set DOTNET_MULTILEVEL_LOOKUP=0 |
| 66 | ++ |
| 67 | ++:: Restore the Tools directory |
| 68 | ++call %~dp0init-tools.cmd |
| 69 | ++if NOT [%ERRORLEVEL%]==[0] exit /b 1 |
| 70 | ++ |
| 71 | ++set _toolRuntime=%~dp0Tools |
| 72 | ++set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe |
| 73 | ++set _json=%~dp0config.json |
| 74 | ++ |
| 75 | ++:: run.exe depends on running in the root directory, notably because the config.json specifies |
| 76 | ++:: a relative path to the binclash logger |
| 77 | ++ |
| 78 | ++pushd %~dp0 |
| 79 | ++call %_dotnet% %_toolRuntime%\run.exe "%_json%" %* |
| 80 | ++popd |
| 81 | ++ |
| 82 | ++exit /b %ERRORLEVEL% |
| 83 | +-- |
| 84 | +2.17.1.windows.2 |
| 85 | + |
0 commit comments