Skip to content

Commit

Permalink
Use Distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
mthalman committed Feb 22, 2024
1 parent 59013c6 commit 28f645a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/SourceBuild/content/repo-projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,10 @@
<!-- When items are transferred between projects, they get metadata indicating their source (e.g. MSBuildSourceProjectFile).
This is problematic because it causes introduces distinctness on the items. For example, an arcade RepositoryReference
that comes from both msbuild and source-build-externals will be treated as two separate items. But we only want one arcade
reference. To prevent this from happening, we need to remove the extra metadata so the two references can be seen as duplicates. -->
reference. To prevent this from happening, use the Distinct method which operates on just the Identity to get a unique set
of values. -->
<ItemGroup>
<_TransitiveRepositoryReference Include="@(_DependencyTransitiveRepositoryReference)"
RemoveMetadata="MSBuildSourceProjectFile;MSBuildSourceTargetName;OriginalItemSpec" />
<TransitiveRepositoryReference Include="@(_TransitiveRepositoryReference)" KeepDuplicates="false" />
<TransitiveRepositoryReference Include="@(_DependencyTransitiveRepositoryReference->Distinct())" />
</ItemGroup>

<!-- Exclude repositories that currently don't build when not building source-only. -->
Expand Down

0 comments on commit 28f645a

Please sign in to comment.