2
2
setlocal
3
3
4
4
set INIT_TOOLS_LOG = %~dp0 init-tools.log
5
- if [%PACKAGES_DIR% ]== [] set PACKAGES_DIR = %~dp0 packages\
5
+ if [%PACKAGES_DIR% ]== [] set PACKAGES_DIR = %~dp0 packages
6
6
if [%TOOLRUNTIME_DIR% ]== [] set TOOLRUNTIME_DIR = %~dp0 Tools
7
7
set DOTNET_PATH = %TOOLRUNTIME_DIR% \dotnetcli\
8
8
if [%DOTNET_CMD% ]== [] set DOTNET_CMD = %DOTNET_PATH% dotnet.exe
9
9
if [%BUILDTOOLS_SOURCE% ]== [] set BUILDTOOLS_SOURCE = https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json
10
10
set /P BUILDTOOLS_VERSION = < " %~dp0 BuildToolsVersion.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
12
12
set INIT_TOOLS_RESTORE_PROJECT = %~dp0 init-tools.msbuild
13
13
set BUILD_TOOLS_SEMAPHORE_DIR = %TOOLRUNTIME_DIR% \%BUILDTOOLS_VERSION%
14
14
set BUILD_TOOLS_SEMAPHORE = %BUILD_TOOLS_SEMAPHORE_DIR% \init-tools.completed
15
15
16
16
:: if force option is specified then clean the tool runtime and build tools package directory to force it to get recreated
17
17
if [%1 ]== [force] (
18
18
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"
20
20
)
21
21
22
22
:: If semaphore exists do nothing
@@ -63,9 +63,9 @@ if NOT exist "%DOTNET_LOCAL_PATH%" (
63
63
64
64
if exist " %BUILD_TOOLS_PATH% " goto :afterbuildtoolsrestore
65
65
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" (
69
69
echo ERROR: Could not restore build tools correctly. 1 >& 2
70
70
goto :error
71
71
)
@@ -76,8 +76,8 @@ if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
76
76
set /p ILASMCOMPILER_VERSION = < " %~dp0 ILAsmVersion.txt"
77
77
78
78
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% "
81
81
set INIT_TOOLS_ERRORLEVEL = %ERRORLEVEL%
82
82
if not [%INIT_TOOLS_ERRORLEVEL% ]== [0] (
83
83
echo ERROR: An error occured when trying to initialize the tools. 1 >& 2
0 commit comments