-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
RawTargetFrameworks
attribute on ProjectReferences as it isn't required anymore as the TargetFrameworks attribute contains everything needed for the best target framework selection.