diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2019-12-11 23:01:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 23:01:58 +0300 |
commit | f5957b1bae3028fd3854230164d9f18b40c7193f (patch) | |
tree | 0638593a927725fcf4886916411e67e5d486bd70 /dotnet.cmd | |
parent | 071da4c41aa808c949a773b92dca6f88de9d11f3 (diff) |
Move dotnet.cmd/sh helper scripts into the repo root (#672)
* Move dotnet helper scripts to repo root
* Don't swallow InitializeDotNetCli output
* Use temporary file to store sdk location
To avoid a nested process chain in which the inner process then invokes
the host, we instead create a temporary file to store the sdk location.
Diffstat (limited to 'dotnet.cmd')
-rw-r--r-- | dotnet.cmd | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/dotnet.cmd b/dotnet.cmd new file mode 100644 index 00000000000..b3cf59daa28 --- /dev/null +++ b/dotnet.cmd @@ -0,0 +1,22 @@ +@echo off + +powershell -ExecutionPolicy ByPass -NoProfile -Command "& { . '%~dp0eng\common\tools.ps1'; InitializeDotNetCli $true $true }" + +if NOT [%ERRORLEVEL%] == [0] ( + echo Failed to install or invoke dotnet... 1>&2 + exit /b %ERRORLEVEL% +) + +set /p dotnetPath=<%~dp0artifacts\toolset\sdk.txt + +:: 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= + +:: Don't resolve runtime, shared framework, or SDK from other locations to ensure build determinism +set DOTNET_MULTILEVEL_LOOKUP=0 + +:: Disable first run since we want to control all package sources +set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + +call "%dotnetPath%\dotnet.exe" %* |