Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<MicrosoftCodeAnalysisCommonPackageVersion>3.7.0</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>3.7.0</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>3.7.0</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>3.3.0-beta2.final</MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>3.3.0</MicrosoftCodeAnalysisPublicApiAnalyzersPackageVersion>
<MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>3.0.0</MicrosoftCodeAnalysisFxCopAnalyzersPackageVersion>
<MicrosoftCssParserPackageVersion>1.0.0-20200708.1</MicrosoftCssParserPackageVersion>
<MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>3.19.8</MicrosoftIdentityModelClientsActiveDirectoryPackageVersion>
Expand Down
22 changes: 11 additions & 11 deletions eng/targets/CSharp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
<!-- Public members should not use oblivious types. Not done with all nullable annotations. -->
<NoWarn>$(NoWarn);RS0041</NoWarn>
</PropertyGroup>
<ItemGroup Condition=" '$(IsImplementationProject)' == 'true' AND

<ItemGroup Condition=" Exists('$(MSBuildProjectDirectory)\PublicAPI.*.txt') AND
'$(IsImplementationProject)' == 'true' AND
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New version emits errors if Public API baseline files are missing

Copy link
Member

Choose a reason for hiding this comment

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

Nice - would be good to revert this once we can fix all the occurrences.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree. If we undid this change and eliminated analyzers and msbuild tasks, we'd know for sure the public API is covered. Might need to invent a special ImNotPubliclyConsumable flag for Microsoft.Web.Xdt.Extensions and other special cases😺

First, we need to be able to analyze projects containing *.cshtml or *.razor files:

  • Microsoft.AspNetCore.Authentication.AzureAD.UI
  • Microsoft.AspNetCore.Authentication.AzureADB2C.UI
  • Microsoft.AspNetCore.Components.Authorization
  • Microsoft.AspNetCore.Identity.UI

Do we have an issue tracking this problem❔ /cc @sharwell @mavasani

Copy link
Member

Choose a reason for hiding this comment

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

dotnet/roslyn#47350 is tracking it, but it might need to be fixed in aspnetcore.

'$(DotNetBuildFromSource)' != 'true' AND
! $(RepoRelativeProjectDir.Contains('Tools')) ">
<!-- Package does nothing in projects lacking PublicAPI.Shipped.txt or PublicAPI.Unshipped.txt files. -->
<Reference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" ExcludeAssets="Compile" PrivateAssets="All" />

<AdditionalFiles Include="PublicAPI.Shipped.txt"
Condition=" Exists('$(MSBuildProjectDirectory)\PublicAPI.Shipped.txt') " />
<AdditionalFiles Include="PublicAPI.Unshipped.txt"
Condition=" Exists('$(MSBuildProjectDirectory)\PublicAPI.Unshipped.txt') " />
<AdditionalFiles Include="PublicAPI.Shipped.txt"
Condition=" Exists('$(MSBuildProjectDirectory)\$(_TFMDirectory)\PublicAPI.Shipped.txt') " />
<AdditionalFiles Include="PublicAPI.Unshipped.txt"
Condition=" Exists('$(MSBuildProjectDirectory)\$(_TFMDirectory)\PublicAPI.Unshipped.txt') " />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the .targets file for the package now

</ItemGroup>
<Target Name="_CheckIgnoredPublicApiFiles"
BeforeTargets="Build;Restore"
Condition=" Exists('$(MSBuildProjectDirectory)\PublicAPI.*.txt') AND
!('$(IsImplementationProject)' == 'true' AND
'$(DotNetBuildFromSource)' != 'true' AND
! $(RepoRelativeProjectDir.Contains('Tools'))) ">
<Warning Text="Public API baseline files ignored." />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

just in case 😺

</Target>

<Target Name="GetCustomAssemblyAttributes"
BeforeTargets="GetAssemblyAttributes"
Expand Down