Allow trimming out incompatible ProjectReferences#8459
Conversation
Today filtering out incompatible inner builds happens in outer builds via hooking the DispatchToInnerBuild target. This works well when your project multi-targets and actually has an outer-build but for single target framework projects filtering isn't possible that way. Instead for traversal builds filter via the ResolveP2PReferences target. Also removing the RawTargetFrameworks attribute on ProjectReferences as it isn't required anymore as the TargetFrameworks attribute contains everything needed for the best target framework selection.
|
Just noticed that I forgot to actually request reviews :D @safern @ericstj could you please take a look? This is required to avoid building incompatible projects which don't multi-target, i.e. with |
...t.Build.Tasks.TargetFramework/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.targets
Outdated
Show resolved
Hide resolved
ericstj
left a comment
There was a problem hiding this comment.
I had just a nit on the naming. Where will you set this property? I don't expect us to set this in any of our library projects, just in the traversal projects, right?
Correct, this will just be set in the traversal projects (today those are called ref.proj, src.proj and tests.proj). |
|
@ericstj for some reason your approval was dismissed. Can you please re-approve? |
Filtering out incompatible inner builds in traversal builds happens in outer builds via hooking onto the DispatchToInnerBuild target. This works well when the project multi-targets and actually has an outer-build but which isn't true for single target framework projects. Instead during traversal builds (i.e. which are orchestrated by the ref.proj, src.proj and tests.proj projects in dotnet/runtime), filter via the ResolveP2PReferences target.
Also removing the
RawTargetFrameworksattribute on ProjectReferences as it isn't required anymore as the TargetFrameworks attribute contains everything needed for the best target framework selection.