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

Commit 81bd3d3

Browse files
committed
Check for duplicate types in framework packages
Examine framework packages for any duplicate types.
1 parent 901af62 commit 81bd3d3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

pkg/Microsoft.Private.CoreFx.UAP/Microsoft.Private.CoreFx.UAP.pkgproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
<ExcludeFromClosure Include="System.Net" />
3636
<ExcludeFromClosure Include="System.Transactions" />
3737

38+
<ExcludeFromDuplicateTypes Include="System.Private.Reflection.Metadata.Ecma335" />
39+
3840
<!-- Permit the following implementation-only assemblies -->
3941
<ValidatePackageSuppression Condition="'$(PackageTargetRuntime)' != ''" Include="PermitInbox">
4042
<Value>

pkg/frameworkPackage.targets

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,25 @@
114114

115115
</Target>
116116

117+
<Target Name="VerifyDuplicateTypes"
118+
DependsOnTargets="GetClosureFiles"
119+
AfterTargets="Build"
120+
Inputs="%(ClosureFile.FileSet)"
121+
Outputs="batching-on-FileSet-metadata">
122+
<ItemGroup>
123+
<_dupTypeFileName Include="@(ClosureFile->'%(FileName)')">
124+
<Original>%(Identity)</Original>
125+
</_dupTypeFileName>
126+
<_dupTypeFileNamesFiltered Include="@(_dupTypeFileName)" Exclude="@(ExcludeFromDuplicateTypes)"/>
127+
<_dupTypeFileFiltered Include="@(_dupTypeFileNamesFiltered->'%(Original)')"/>
128+
</ItemGroup>
129+
130+
<Message Importance="High" Text="Verifying no duplicate types in $(Id) %(ClosureFile.FileSet) assemblies" />
131+
<VerifyTypes Sources="@(_dupTypeFileFiltered)"
132+
IgnoredTypes="@(IgnoredDuplicateType)" />
133+
134+
</Target>
135+
117136
<Target Name="VerifyNETStandard"
118137
DependsOnTargets="GetClosureFiles"
119138
AfterTargets="Build"

0 commit comments

Comments
 (0)