Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit dbabdc1

Browse files
weshaggardstephentoub
authored andcommitted
Use IlAsm infra from BuildTools (#25649)
1 parent 444efb2 commit dbabdc1

File tree

7 files changed

+21
-39
lines changed

7 files changed

+21
-39
lines changed

dependencies.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@
161161
<Path>$(MSBuildThisFileDirectory)BuildToolsVersion.txt</Path>
162162
<PackageId>Microsoft.DotNet.BuildTools</PackageId>
163163
</UpdateStep>
164+
<UpdateStep Include="BuildTools">
165+
<UpdaterType>File</UpdaterType>
166+
<Path>$(MSBuildThisFileDirectory)tools-local/ILAsmVersion.txt</Path>
167+
<PackageId>Microsoft.NETCore.ILAsm</PackageId>
168+
</UpdateStep>
164169
<XmlUpdateStep Include="BuildTools">
165170
<Path>$(MSBuildThisFileFullPath)</Path>
166171
<ElementName>XunitNetcoreExtensionsVersion</ElementName>

external/dir.proj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<Project Include="test-runtime/XUnit.Runtime.depproj" Condition="'$(DotNetBuildFromSource)' != 'true'" />
1515
<Project Include="harvestPackages/harvestPackages.depproj" />
1616
<Project Include="portable/portable.depproj" />
17-
<Project Include="ilasm/ilasm.depproj" />
1817
<Project Include="docs/docs.depproj" Condition="'$(DotNetBuildFromSource)' != 'true'" />
1918
<Project Condition="'$(ILLinkTrimAssembly)' != 'false'" Include="ILLink/ILLink.depproj" />
2019
</ItemGroup>

external/ilasm/Configurations.props

Lines changed: 0 additions & 10 deletions
This file was deleted.

external/ilasm/ilasm.depproj

Lines changed: 0 additions & 26 deletions
This file was deleted.

init-tools.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ if NOT exist "%BUILD_TOOLS_PATH%init-tools.cmd" (
7070

7171
:afterbuildtoolsrestore
7272

73+
:: Ask init-tools to also restore ILAsm
74+
set /p ILASMCOMPILER_VERSION=< "%~dp0tools-local\ILAsmVersion.txt"
75+
7376
echo Initializing BuildTools...
7477
echo Running: "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"
7578
call "%BUILD_TOOLS_PATH%init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%"

init-tools.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ if [ -z "$__BUILDTOOLS_SOURCE" ]; then __BUILDTOOLS_SOURCE=https://dotnet.myget.
1010
export __BUILDTOOLS_USE_CSPROJ=true
1111
__BUILD_TOOLS_PACKAGE_VERSION=$(cat $__scriptpath/BuildToolsVersion.txt)
1212
__DOTNET_TOOLS_VERSION=$(cat $__scriptpath/DotnetCLIVersion.txt)
13+
__ILASM_VERSION=$(cat $__scriptpath/tools-local/ILAsmVersion.txt)
1314
__BUILD_TOOLS_PATH=$__PACKAGES_DIR/microsoft.dotnet.buildtools/$__BUILD_TOOLS_PACKAGE_VERSION/lib
1415
__INIT_TOOLS_RESTORE_PROJECT=$__scriptpath/init-tools.msbuild
1516
__BUILD_TOOLS_SEMAPHORE=$__TOOLRUNTIME_DIR/$__BUILD_TOOLS_PACKAGE_VERSION/init-tools.complete
@@ -47,15 +48,15 @@ display_error_message()
4748
execute_with_retry() {
4849
local count=0
4950
local retries=${retries:-5}
50-
local waitFactor=${waitFactor:-6}
51+
local waitFactor=${waitFactor:-6}
5152
until "$@"; do
5253
local exit=$?
5354
count=$(( $count + 1 ))
5455
if [ $count -lt $retries ]; then
5556
local wait=$(( waitFactor ** (( count - 1 )) ))
5657
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
5758
sleep $wait
58-
else
59+
else
5960
say_err "Retry $count/$retries exited $exit, no more retries left."
6061
return $exit
6162
fi
@@ -147,6 +148,15 @@ if [ ! -e $__BUILD_TOOLS_PATH ]; then
147148
fi
148149
fi
149150

151+
if [ -z "$__ILASM_RID" ]; then
152+
__ILASM_RID=$__PKG_RID-$__PKG_ARCH
153+
fi
154+
155+
echo "Using RID $__ILASM_RID for BuildTools native tools"
156+
157+
export ILASMCOMPILER_VERSION=$__ILASM_VERSION
158+
export NATIVE_TOOLS_RID=$__ILASM_RID
159+
150160
echo "Initializing BuildTools..."
151161
echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> $__init_tools_log
152162

tools-local/ILAsmVersion.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.1.0-preview1-25929-01

0 commit comments

Comments
 (0)