-
Notifications
You must be signed in to change notification settings - Fork 352
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
Fix PublicAPI build checks #2575
Conversation
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
||
<Import Project="..\Build.props" /> | ||
|
||
<PropertyGroup Condition="'$(TreatWarningsAsErrors)' == 'false' or '$(TreatWarningsAsErrors)' == ''"> |
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.
Does this not belong in the ../Build.props?
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.
We use Build.props
in our test projects as well, which we don't ship publicly. I can try to consolidate the csproj elements used by our shipped projects into a .props
file though if you think that makes sense.
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.
Currently, we don't get build errors when the public API surface has changed but the corresponding
PublicAPI.Unshipped.txt
has not been updated. This is because we get warnings that there are duplicate entries inPublicAPI.Unshipped.txt
andPublicAPI.Shipped.txt
. Because the analyzer doesn't know what to do when it encounters those warnings, it doesn't go on to generate the errors that there are missing entries in the text file (effectively disabling the public API build checks).This change upgrades those duplicate entry warnings to errors, and it also upgrades the warning that an entry exists in the text file but doesn't correspond to a public API. These two will prevent us from accidentally "disabling" the public API build checks in the future.
This change also addresses the issues in the existing
PublicAPI.*.txt
files, removing the duplicate entries from theUnshipped
variants.It also adds support in
Core
andClient
for multiple target frameworks in preparation for #2433.