Skip to content

Commit 81a3dcd

Browse files
authored
Remove hardcoded non trimmable assemblies in oob.proj (#72171)
* 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
1 parent 178553b commit 81a3dcd

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

eng/illink.targets

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
<!-- ApiCompat should perform compatibility checks on the trimmed assemblies. -->
77
<ApiCompatDependsOn>$(ApiCompatDependsOn);ILLinkTrimAssembly</ApiCompatDependsOn>
88
</PropertyGroup>
9+
10+
<!-- Flow the IsTrimmable property down to consuming projects, in order for oob.proj
11+
to exclude non trimmable assemblies. -->
12+
<ItemDefinitionGroup>
13+
<TargetPathWithTargetPlatformMoniker>
14+
<IsTrimmable>$(IsTrimmable)</IsTrimmable>
15+
</TargetPathWithTargetPlatformMoniker>
16+
</ItemDefinitionGroup>
917

1018
<!-- Inputs and outputs of ILLinkTrimAssembly -->
1119
<PropertyGroup>

src/libraries/oob.proj

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,29 +45,8 @@
4545
<!-- Include suppression XML files bin-placed in earlier per-library linker run. -->
4646
<OOBLibrarySuppressionsXml Include="$(ILLinkTrimAssemblyOOBSuppressionsXmlsDir)*.xml" />
4747

48-
<!-- The following is the list of all the OOBs we will ignore for now -->
49-
<OOBAssemblyToIgnore Include="System.CodeDom;
50-
System.ComponentModel.Composition;
51-
System.ComponentModel.Composition.Registration;
52-
System.Composition.AttributedModel;
53-
System.Composition.Convention;
54-
System.Composition.Hosting;
55-
System.Composition.Runtime;
56-
System.Composition.TypedParts;
57-
System.Configuration.ConfigurationManager;
58-
System.Speech;
59-
Microsoft.Extensions.DependencyInjection.Specification.Tests" />
60-
61-
<!-- Move items to FileName so that we can subtract them. -->
62-
<OOBAssemblyWithFilename Include="@(OOBAssembly->Metadata('Filename'))"
63-
OriginalIdentity="%(Identity)" />
64-
<OOBAssemblyToTrimWithFilename Include="@(OOBAssemblyWithFilename)"
65-
Exclude="@(OOBAssemblyToIgnore)" />
66-
<OOBAssemblyToIgnoreWithFilename Include="@(OOBAssemblyWithFilename)"
67-
Exclude="@(OOBAssemblyToTrimWithFilename)" />
68-
69-
<OOBAssemblyToTrim Include="@(OOBAssemblyToTrimWithFilename->Metadata('OriginalIdentity'))" />
70-
<OOBAssemblyReference Include="@(OOBAssemblyToIgnoreWithFilename->Metadata('OriginalIdentity'));
48+
<OOBAssemblyToTrim Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'true'))" />
49+
<OOBAssemblyReference Include="@(OOBAssembly->WithMetadataValue('IsTrimmable', 'false'));
7150
@(SharedFrameworkAssembly)" />
7251
</ItemGroup>
7352
</Target>

0 commit comments

Comments
 (0)