2017-04-10 11:41:01 +00:00
|
|
|
@if not defined _echo @echo off
|
|
|
|
setlocal
|
|
|
|
|
2017-06-07 13:16:24 +00:00
|
|
|
:: Default to highest Visual Studio version available
|
|
|
|
::
|
|
|
|
:: For VS2015 (and prior), only a single instance is allowed to be installed on a box
|
|
|
|
:: and VS140COMNTOOLS is set as a global environment variable by the installer. This
|
|
|
|
:: allows users to locate where the instance of VS2015 is installed.
|
|
|
|
::
|
|
|
|
:: For VS2017, multiple instances can be installed on the same box SxS and VS150COMNTOOLS
|
|
|
|
:: is no longer set as a global environment variable and is instead only set if the user
|
|
|
|
:: has launched the VS2017 Developer Command Prompt.
|
|
|
|
::
|
|
|
|
:: Following this logic, we will default to the VS2017 toolset if VS150COMNTOOLS tools is
|
|
|
|
:: set, as this indicates the user is running from the VS2017 Developer Command Prompt and
|
|
|
|
:: is already configured to use that toolset. Otherwise, we will fallback to using the VS2015
|
|
|
|
:: toolset if it is installed. Finally, we will fail the script if no supported VS instance
|
|
|
|
:: can be found.
|
2018-01-24 17:04:36 +00:00
|
|
|
|
|
|
|
if defined VisualStudioVersion goto :Run
|
|
|
|
|
|
|
|
set _VSWHERE="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
|
|
if exist %_VSWHERE% (
|
2018-01-29 19:03:06 +00:00
|
|
|
for /f "usebackq tokens=*" %%i in (`%_VSWHERE% -latest -prerelease -property installationPath`) do set _VSCOMNTOOLS=%%i\Common7\Tools
|
2018-01-24 17:04:36 +00:00
|
|
|
)
|
|
|
|
if not exist "%_VSCOMNTOOLS%" set _VSCOMNTOOLS=%VS140COMNTOOLS%
|
|
|
|
if not exist "%_VSCOMNTOOLS%" (
|
2017-06-07 13:16:24 +00:00
|
|
|
echo Error: Visual Studio 2015 or 2017 required.
|
2017-04-10 11:41:01 +00:00
|
|
|
echo Please see https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md for build instructions.
|
|
|
|
exit /b 1
|
|
|
|
)
|
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
call "%_VSCOMNTOOLS%\VsDevCmd.bat"
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
:Run
|
|
|
|
:: Clear the 'Platform' env variable for this session, as it's a per-project setting within the build, and
|
|
|
|
:: misleading value (such as 'MCD' in HP PCs) may lead to build breakage (issue: #69).
|
|
|
|
set Platform=
|
|
|
|
|
2018-01-29 19:03:06 +00:00
|
|
|
:: Disable telemetry, first time experience, and global sdk look for the CLI
|
|
|
|
set DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
|
|
|
set DOTNET_MULTILEVEL_LOOKUP=0
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
:: Restore the Tools directory
|
|
|
|
call %~dp0init-tools.cmd
|
|
|
|
if NOT [%ERRORLEVEL%]==[0] exit /b 1
|
|
|
|
|
|
|
|
set _toolRuntime=%~dp0Tools
|
|
|
|
set _dotnet=%_toolRuntime%\dotnetcli\dotnet.exe
|
2017-08-21 15:34:15 +00:00
|
|
|
set _json=%~dp0config.json
|
|
|
|
|
|
|
|
:: run.exe depends on running in the root directory, notably because the config.json specifies
|
|
|
|
:: a relative path to the binclash logger
|
|
|
|
|
|
|
|
pushd %~dp0
|
|
|
|
call %_dotnet% %_toolRuntime%\run.exe "%_json%" %*
|
|
|
|
popd
|
2017-04-10 11:41:01 +00:00
|
|
|
|
|
|
|
exit /b %ERRORLEVEL%
|