forked from dotnet/coreclr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotnet.cmd
41 lines (30 loc) · 1.24 KB
/
dotnet.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@if not defined _echo @echo off
setlocal
set "__ProjectDir=%~dp0"
set "__RepoRootDir=%__ProjectDir%..\..\"
rem Remove after repo consolidation
if not exist "%__RepoRootDir%\.dotnet-runtime-placeholder" ( set "__RepoRootDir=%__ProjectDir%" )
:: 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 do not need all ASP.NET packages restored.
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set PS_DOTNET_INSTALL_SCRIPT=". %__RepoRootDir%eng\common\tools.ps1; InitializeDotNetCli($true)"
set "PS_COMMAND=powershell -NoProfile -ExecutionPolicy unrestricted -Command %PS_DOTNET_INSTALL_SCRIPT%"
echo running: %PS_COMMAND%
for /f "delims=" %%l in ('%PS_COMMAND%') do set "__dotnetDir=%%l"
if NOT [%ERRORLEVEL%] == [0] (
echo Failed to install dotnet using Arcade.
exit /b %ERRORLEVEL%
)
set "dotnetPath=%__dotnetDir%\dotnet.exe"
pushd %~dp0
echo Running: "%dotnetPath%" %*
call "%dotnetPath%" %*
popd
if NOT [%ERRORLEVEL%]==[0] (
exit /b 1
)
exit /b 0