diff options
author | Sejong Oh <sejooh@microsoft.com> | 2016-03-15 13:56:41 -0700 |
---|---|---|
committer | Sejong OH <sejooh@microsoft.com> | 2016-03-16 16:58:30 -0700 |
commit | 62e0f5c054524a14ab35f93d78e6ee820c4e03aa (patch) | |
tree | 3aa558327eecc08babe418de49c499bbf1adc6e3 /tests/setup-runtime-dependencies.cmd | |
parent | c37aae496c6d83ddd49c96e0eeb9cc1bce2bff76 (diff) | |
download | coreclr-62e0f5c054524a14ab35f93d78e6ee820c4e03aa.tar.gz coreclr-62e0f5c054524a14ab35f93d78e6ee820c4e03aa.tar.bz2 coreclr-62e0f5c054524a14ab35f93d78e6ee820c4e03aa.zip |
Fix setup-runtime-dependencies.cmd
Diffstat (limited to 'tests/setup-runtime-dependencies.cmd')
-rwxr-xr-x[-rw-r--r--] | tests/setup-runtime-dependencies.cmd | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/tests/setup-runtime-dependencies.cmd b/tests/setup-runtime-dependencies.cmd index e7d6099b8d..6c7f6d10b1 100644..100755 --- a/tests/setup-runtime-dependencies.cmd +++ b/tests/setup-runtime-dependencies.cmd @@ -42,22 +42,30 @@ REM ============================================================================ set __DotNetToolDir=%__ThisScriptPath%..\Tools set __DotNetCmd=%__DotNetToolDir%\dotnetcli\bin\dotnet.exe set __PackageDir=%__ThisScriptPath%..\Packages -set __JasonFilePath=%__ThisScriptPath%project.json +set __TmpDir=%Temp%\coreclr_gcstress_%RANDOM% -REM Check if dotnet CLI exists +REM Check if donet cli exists if not exist "%__DotNetToolDir%" ( echo Directory containing dotnet CLI does not exist: %__DotNetToolDir% - exit /b 1 + goto Fail ) if not exist "%__DotNetCmd%" ( echo dotnet.exe does not exist: %__DotNetCmd% - exit /b 1 + goto Fail ) REM Create directories needed if not exist "%__PackageDir%" md "%__PackageDir%" if not exist "%__OutputDir%" md "%__OutputDir%" +REM Check and create a temp directory +if exist "%__TmpDir%" ( + rmdir /S /Q %__TmpDir% +) +mkdir %__TmpDir% + +REM Project.json path +set __JasonFilePath=%__TmpDir%\project.json REM ========================================================================================= REM === @@ -75,15 +83,16 @@ echo { ^ REM Download the package echo Downloading CoreDisTools package -echo on -call "%__DotNetCmd%" restore "%__JasonFilePath%" --source https://dotnet.myget.org/F/dotnet-core/ --packages "%__PackageDir%" -@echo off +set DOTNETCMD="%__DotNetCmd%" restore "%__JasonFilePath%" --source https://dotnet.myget.org/F/dotnet-core/ --packages "%__PackageDir%" +echo %DOTNETCMD% +call %DOTNETCMD% +if errorlevel 1 goto Fail REM Get downloaded dll path -FOR /F "delims=" %%i IN ('dir coredistools.dll /b/s') DO set __LibPath=%%i +FOR /F "delims=" %%i IN ('dir %__PackageDir%\coredistools.dll /b/s') DO set __LibPath=%%i if not exist "%__LibPath%" ( echo Failed to locate the downloaded library: %__LibPath% - exit /b 1 + goto Fail ) REM Copy library to output directory @@ -91,10 +100,18 @@ echo Copy library: %__LibPath% to %__OutputDir% copy /y "%__LibPath%" "%__OutputDir%" REM Delete temporary files -del "%__JasonFilePath%" +if exist "%__TmpDir%" ( + rmdir /S /Q "%__TmpDir%" +) exit /b 0 +:Fail +if exist "%__TmpDir%" ( + rmdir /S /Q "%__TmpDir%" +) +exit /b 1 + REM ========================================================================================= REM === REM === Helper routines |