-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding publicAPI, bannedApi, and Async analyzers #136
Changes from 2 commits
cc15e19
3af4b43
f1bc559
041a2bd
230495f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,18 @@ | |
<LangVersion>12</LangVersion> | ||
<EnablePackageValidation>true</EnablePackageValidation> | ||
<PackageValidationBaselineVersion>5.0.0</PackageValidationBaselineVersion> | ||
</PropertyGroup> | ||
<BannedApiAnalyzersVersion>3.3.4</BannedApiAnalyzersVersion> | ||
<MicrosoftCodeAnalysisPublicApiAnalyzers>3.3.4</MicrosoftCodeAnalysisPublicApiAnalyzers> | ||
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion> | ||
<MicrosoftInternalAnalyzersVersion>2.9.7</MicrosoftInternalAnalyzersVersion> | ||
</PropertyGroup> | ||
|
||
<!-- This step doesn't build on our Linux pipeline. --> | ||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' "> | ||
<EnforcePublicApiAnalyzer>true</EnforcePublicApiAnalyzer> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Label="Source Link"> | ||
<PropertyGroup Label="Source Link"> | ||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Build symbol package (.snupkg) to distribute the PDB containing Source Link --> | ||
|
@@ -39,7 +48,8 @@ | |
<!-- The MSAL.snk has both private and public keys --> | ||
<DelaySign>false</DelaySign> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | ||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can simplify a bit if we don't want to have opt outs. These can go, and the conditions in the item groups can go. |
||
<EnforceThreadingAnalyzers>true</EnforceThreadingAnalyzers> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'"> | ||
|
@@ -60,4 +70,28 @@ | |
<ItemGroup Label="Build Tools" Condition="$([MSBuild]::IsOsPlatform('Windows'))"> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | ||
</ItemGroup> | ||
|
||
<!-- Dont run analyzers on notargets projects. --> | ||
<ItemGroup Condition="'$(UsingMicrosoftNoTargetsSdk)' != 'true'"> | ||
<!-- PrivateAssets="All" is on these packages to ensure they're development dependencies | ||
and aren't included as transitionary dependencies to package consumers. | ||
For clarity, without PrivateAssets marked here, anyone consuming Microsoft.Identity.ServiceEssentials | ||
would also be forced to install these dependencies. PrivateAssets avoids this problem. --> | ||
<PackageReference Include="Microsoft.Internal.Analyzers" Version="$(MicrosoftInternalAnalyzersVersion)"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(EnforceThreadingAnalyzers)' == 'true'"> | ||
<!-- Protects against sync-over-async: https://github.com/microsoft/vs-threading/blob/main/doc/analyzers/index.md. --> | ||
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" PrivateAssets="all" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(MicrosoftCodeAnalysisPublicApiAnalyzers)" Condition="'$(EnforcePublicApiAnalyzer)' == 'true'"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
</Project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,7 +115,7 @@ namespace Microsoft.Identity.Abstractions | |
/// </code> | ||
/// </example> | ||
<# if (framework != "net8"){ #> | ||
#if NET6_0_OR_GREATER | ||
#if NET8_0_OR_GREATER | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't build for NET6.0 any longer. |
||
[RequiresUnreferencedCode("This method's implementations also use generic types and are not trim-friendly.")] | ||
#endif | ||
<# } #> | ||
|
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.
alignment is off