-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
When the SDK version is updated to latest, we are going to need to make some changes to the tools, so they stop referencing the new APIs via links and simply consume latest version of System.Reflection.Metadata package.
Here is the list of things that it will requires
- Remove links to files from
ILVerification.projitems:
runtime/src/coreclr/tools/ILVerification/ILVerification.projitems
Lines 69 to 98 in 127844c
<Compile Include="$(LibrariesProjectRoot)\Common\src\System\HexConverter.cs"> <Link>Utilities\HexConverter.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\AssemblyNameFormatter.cs"> <Link>Utilities\AssemblyNameFormatter.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\AssemblyNameParser.cs"> <Link>Utilities\AssemblyNameParser.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\AssemblyNameInfo.cs"> <Link>Utilities\Metadata\AssemblyNameInfo.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeName.cs"> <Link>Utilities\TypeName.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParserOptions.cs"> <Link>Utilities\TypeNameParserOptions.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParser.cs"> <Link>Utilities\TypeNameParser.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParserHelpers.cs"> <Link>Utilities\TypeNameParserHelpers.cs</Link> </Compile> <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\UnconditionalSuppressMessageAttribute.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'"> <Link>System\Diagnostics\CodeAnalysis\UnconditionalSuppressMessageAttribute.cs</Link> </Compile> <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'"> <Link>System\Diagnostics\CodeAnalysis\NullableAttributes.cs</Link> </Compile>
runtime/src/coreclr/tools/ILVerification/ILVerification.projitems
Lines 105 to 107 in 127844c
<Compile Include="$(LibrariesProjectRoot)\Common\src\System\Text\ValueStringBuilder.AppendSpanFormattable.cs" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"> <Link>Utilities\ValueStringBuilder.AppendSpanFormattable.cs</Link> </Compile> - And from
ILCompiler.TypeSystem.csproj:
runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
Lines 201 to 224 in 127844c
<Compile Include="$(LibrariesProjectRoot)\Common\src\System\HexConverter.cs"> <Link>Utilities\HexConverter.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\AssemblyNameFormatter.cs"> <Link>Utilities\AssemblyNameFormatter.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\AssemblyNameParser.cs"> <Link>Utilities\AssemblyNameParser.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\AssemblyNameInfo.cs"> <Link>Utilities\AssemblyNameInfo.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeName.cs"> <Link>Utilities\TypeName.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParser.cs"> <Link>Utilities\TypeNameParser.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParserHelpers.cs"> <Link>Utilities\TypeNameParserHelpers.cs</Link> </Compile> <Compile Include="$(LibrariesProjectRoot)\Common\src\System\Reflection\Metadata\TypeNameParserOptions.cs"> <Link>Utilities\TypeNameParserOptions.cs</Link> </Compile>
runtime/src/coreclr/tools/aot/ILCompiler.TypeSystem/ILCompiler.TypeSystem.csproj
Lines 231 to 233 in 127844c
<Compile Include="$(LibrariesProjectRoot)\Common\src\System\Text\ValueStringBuilder.AppendSpanFormattable.cs"> <Link>Utilities\ValueStringBuilder.AppendSpanFormattable.cs</Link> </Compile> - Move all the files from
src/libraries/Common/src/System/Reflection/Metadata/*.cstosrc/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/ - Remove
#nullable enablefrom following files:
#nullable enable
#nullable enable
#nullable enable
#nullable enable
#nullable enable
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Line 10 in 127844c
#nullable enable
runtime/src/libraries/Common/src/System/Text/ValueStringBuilder.AppendSpanFormattable.cs
Line 4 in d0dffe1
#nullable enable
- Change the
#iftopublicforSYSTEM_REFLECTION_METADATA, otherwiseinternal(https://github.com/dotnet/runtime/pull/100094/files#r1577334880)
runtime/src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs
Lines 24 to 28 in 127844c
#if SYSTEM_PRIVATE_CORELIB internal #else public #endif
#if SYSTEM_PRIVATE_CORELIB internal #else public #endif
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserOptions.cs
Lines 6 to 10 in d0dffe1
#if SYSTEM_PRIVATE_CORELIB internal #else public #endif - Remove
#pragma warning disable RS003
#pragma warning disable RS0030 // TypeSystem does not allow System.Linq, but we need to use System.Linq.ImmutableArrayExtensions.ToArray - Simpify throw helpers by removing unused
#if/else/elifblocks:
runtime/src/libraries/Common/src/System/Reflection/Metadata/AssemblyNameInfo.cs
Lines 187 to 189 in 127844c
#else // tools that reference this file as a link : throw new ArgumentException("The given assembly name was invalid.", nameof(assemblyName)); #endif
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Lines 347 to 349 in 127844c
#else // tools that reference this file as a link new ArgumentException(); #endif
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Lines 355 to 357 in 127844c
#else // tools that reference this file as a link new InvalidOperationException(); #endif
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Lines 379 to 381 in 127844c
#else // tools that reference this file as a link new InvalidOperationException(); #endif - Update comments (remove the tools mentions):
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Line 337 in 127844c
#else // corelib and tools that reference this file as a link
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Line 363 in 127844c
#else // corelib and tools that reference this file as a link
runtime/src/libraries/Common/src/System/Reflection/Metadata/TypeNameParserHelpers.cs
Line 371 in 127844c
#else // corelib and tools that reference this file as a link
cc @jkotas