Skip to content

Commit 71f72ee

Browse files
committed
Updating init-tools.cmd to pass through PACKAGES_DIR
1 parent 8d87602 commit 71f72ee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

init-tools.cmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
setlocal
33

44
set INIT_TOOLS_LOG=%~dp0init-tools.log
5-
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages\
5+
if [%PACKAGES_DIR%]==[] set PACKAGES_DIR=%~dp0packages
66
if [%TOOLRUNTIME_DIR%]==[] set TOOLRUNTIME_DIR=%~dp0Tools
77
set DOTNET_PATH=%TOOLRUNTIME_DIR%\dotnetcli\
88
if [%DOTNET_CMD%]==[] set DOTNET_CMD=%DOTNET_PATH%dotnet.exe
99
if [%BUILDTOOLS_SOURCE%]==[] set BUILDTOOLS_SOURCE=https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
1010
set /P BUILDTOOLS_VERSION=< "%~dp0BuildToolsVersion.txt"
11-
set BUILD_TOOLS_PATH=%PACKAGES_DIR%Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib\
11+
set BUILD_TOOLS_PATH=%PACKAGES_DIR%\Microsoft.DotNet.BuildTools\%BUILDTOOLS_VERSION%\lib
1212
set INIT_TOOLS_RESTORE_PROJECT=%~dp0init-tools.msbuild
1313
set BUILD_TOOLS_SEMAPHORE_DIR=%TOOLRUNTIME_DIR%\%BUILDTOOLS_VERSION%
1414
set BUILD_TOOLS_SEMAPHORE=%BUILD_TOOLS_SEMAPHORE_DIR%\init-tools.completed
1515

1616
:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
1717
if [%1]==[force] (
1818
if exist "%TOOLRUNTIME_DIR%" rmdir /S /Q "%TOOLRUNTIME_DIR%"
19-
if exist "%PACKAGES_DIR%Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%Microsoft.DotNet.BuildTools"
19+
if exist "%PACKAGES_DIR%\Microsoft.DotNet.BuildTools" rmdir /S /Q "%PACKAGES_DIR%\Microsoft.DotNet.BuildTools"
2020
)
2121

2222
:: If semaphore exists do nothing
@@ -63,9 +63,9 @@ if NOT exist "%DOTNET_LOCAL_PATH%" (
6363

6464
if exist "%BUILD_TOOLS_PATH%" goto :afterbuildtoolsrestore
6565
echo Restoring BuildTools version %BUILDTOOLS_VERSION%...
66-
echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
67-
call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages %PACKAGES_DIR% --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
68-
if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
66+
echo Running: "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages "%PACKAGES_DIR%" --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
67+
call "%DOTNET_CMD%" restore "%INIT_TOOLS_RESTORE_PROJECT%" --no-cache --packages "%PACKAGES_DIR%" --source "%BUILDTOOLS_SOURCE%" /p:BuildToolsPackageVersion=%BUILDTOOLS_VERSION% /p:ToolsDir=%TOOLRUNTIME_DIR% >> "%INIT_TOOLS_LOG%"
68+
if NOT exist "%BUILD_TOOLS_PATH%\init-tools.cmd" (
6969
echo ERROR: Could not restore build tools correctly. 1>&2
7070
goto :error
7171
)
@@ -76,8 +76,8 @@ if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
7676
set /p ILASMCOMPILER_VERSION=< "%~dp0ILAsmVersion.txt"
7777

7878
echo Initializing BuildTools...
79-
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
80-
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
79+
echo Running: "%BUILD_TOOLS_PATH%\init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
80+
call "%BUILD_TOOLS_PATH%\init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" "%PACKAGES_DIR%" >> "%INIT_TOOLS_LOG%"
8181
set INIT_TOOLS_ERRORLEVEL=%ERRORLEVEL%
8282
if not [%INIT_TOOLS_ERRORLEVEL%]==[0] (
8383
echo ERROR: An error occured when trying to initialize the tools. 1>&2

0 commit comments

Comments
 (0)