Skip to content

Commit

Permalink
Remove hardcoded non trimmable assemblies in oob.proj (#72171)
Browse files Browse the repository at this point in the history
* Remove hardcoded non trimmable assemblies in oob.proj

Fixes #72166

Use the `TargetPathWithTargetPlatformMoniker` to flow through the IsTrimmable property that is set by projects and use that for illink validation assembly selection.

* Update oob.proj

* Update illink.targets
  • Loading branch information
ViktorHofer committed Jul 14, 2022
1 parent 178553b commit 81a3dcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
8 changes: 8 additions & 0 deletions eng/illink.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
<!-- ApiCompat should perform compatibility checks on the trimmed assemblies. -->
<ApiCompatDependsOn>$(ApiCompatDependsOn);ILLinkTrimAssembly</ApiCompatDependsOn>
</PropertyGroup>

<!-- Flow the IsTrimmable property down to consuming projects, in order for oob.proj
to exclude non trimmable assemblies. -->
<ItemDefinitionGroup>
<TargetPathWithTargetPlatformMoniker>
<IsTrimmable>$(IsTrimmable)</IsTrimmable>
</TargetPathWithTargetPlatformMoniker>
</ItemDefinitionGroup>

<!-- Inputs and outputs of ILLinkTrimAssembly -->
<PropertyGroup>
Expand Down
25 changes: 2 additions & 23 deletions src/libraries/oob.proj
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,8 @@
<!-- Include suppression XML files bin-placed in earlier per-library linker run. -->
<OOBLibrarySuppressionsXml Include="$(ILLinkTrimAssemblyOOBSuppressionsXmlsDir)*.xml" />

<!-- The following is the list of all the OOBs we will ignore for now -->
<OOBAssemblyToIgnore Include="System.CodeDom;
System.ComponentModel.Composition;
System.ComponentModel.Composition.Registration;
System.Composition.AttributedModel;
System.Composition.Convention;
System.Composition.Hosting;
System.Composition.Runtime;
System.Composition.TypedParts;
System.Configuration.ConfigurationManager;
System.Speech;
Microsoft.Extensions.DependencyInjection.Specification.Tests" />

<!-- Move items to FileName so that we can subtract them. -->
<OOBAssemblyWithFilename Include="@(OOBAssembly->Metadata('Filename'))"
OriginalIdentity="%(Identity)" />
<OOBAssemblyToTrimWithFilename Include="@(OOBAssemblyWithFilename)"
Exclude="@(OOBAssemblyToIgnore)" />
<OOBAssemblyToIgnoreWithFilename Include="@(OOBAssemblyWithFilename)"
Exclude="@(OOBAssemblyToTrimWithFilename)" />

<OOBAssemblyToTrim Include="@(OOBAssemblyToTrimWithFilename->Metadata('OriginalIdentity'))" />
<OOBAssemblyReference Include="@(OOBAssemblyToIgnoreWithFilename->Metadata('OriginalIdentity'));
<OOBAssemblyToTrim Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'true'))" />
<OOBAssemblyReference Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'false'));
@(SharedFrameworkAssembly)" />
</ItemGroup>
</Target>
Expand Down

0 comments on commit 81a3dcd

Please sign in to comment.