Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libraries/oob-gen.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<Project Sdk="Microsoft.Build.Traversal">

<PropertyGroup Condition="'$(BuildTargetFramework)' != '' and '$(BuildTargetFramework)' == '$(NetFrameworkCurrent)'">
<TargetFramework>$(BuildTargetFramework)</TargetFramework>
<!-- Filter ProjectReferences to build the best matching target framework only. -->
<FilterTraversalProjectReferences>true</FilterTraversalProjectReferences>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this still overbuild in the case that a generator doesn't multi-target? What was causing the overbuild to happen? I would have expected any duplicates to hit the MSBuild project cache - were global properties different?

Copy link
Member Author

@ViktorHofer ViktorHofer Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Different global properties, yes. More precisely, the BuildTargetFramework property set.

This solution works for both multi targeting and non multi-targeting builds and is just following what we already do in the other oob-*.projs. I simpy forgot to add that part.

See https://github.com/dotnet/runtime/blob/main/eng%2FTraversalSdk.AfterTargets.targets

</PropertyGroup>

<!-- Reference all out-of-band generator projects. -->
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)*\gen\**\*.*proj"
Expand Down