Enable Pubternal API checks (#9530)
* Enable Pubternal API checks * Use pragma * Convert to pragma * Test fix * Remove extra restore dependencies
This commit is contained in:
parent
0831456fac
commit
7a040f310b
|
|
@ -79,6 +79,10 @@
|
|||
<PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="$(MicrosoftSourceLinkVstsGitPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(DisablePubternalApiCheck)' != 'true' AND '$(IsTestProject)' != 'true' AND '$(IsBenchmarkProject)' != 'true' AND '$(IsTestAssetProject)' != 'true'">
|
||||
<PackageReference Include="Internal.AspNetCore.Analyzers" PrivateAssets="All" Version="$(InternalAspNetCoreAnalyzersPackageVersion)" AllowExplicitReference="true" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props -->
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,9 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
|
|||
public class AdapterFactory : IAdapterFactory
|
||||
{
|
||||
/// <inheritdoc />
|
||||
#pragma warning disable PUB0001
|
||||
public virtual IAdapter Create(object target, IContractResolver contractResolver)
|
||||
#pragma warning restore PUB0001
|
||||
{
|
||||
if (target == null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
|
|||
/// <param name="target">The target object</param>
|
||||
/// <param name="contractResolver">The current contract resolver</param>
|
||||
/// <returns>The needed <see cref="IAdapter"/></returns>
|
||||
#pragma warning disable PUB0001
|
||||
IAdapter Create(object target, IContractResolver contractResolver);
|
||||
#pragma warning restore PUB0001
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ namespace Microsoft.AspNetCore.TestHost
|
|||
/// </summary>
|
||||
/// <param name="pathBase">The base path.</param>
|
||||
/// <param name="application">The <see cref="IHttpApplication{TContext}"/>.</param>
|
||||
#pragma warning disable PUB0001
|
||||
public ClientHandler(PathString pathBase, IHttpApplication<Context> application)
|
||||
#pragma warning restore PUB0001
|
||||
{
|
||||
_application = application ?? throw new ArgumentNullException(nameof(application));
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,9 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
"to create TemplateBinder instances.")]
|
||||
public TemplateBinder(
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable PUB0001
|
||||
ObjectPool<UriBuildingContext> pool,
|
||||
#pragma warning restore PUB0001
|
||||
RouteTemplate template,
|
||||
RouteValueDictionary defaults)
|
||||
: this(urlEncoder, pool, template?.ToRoutePattern(), defaults, requiredKeys: null, parameterPolicies: null)
|
||||
|
|
@ -70,7 +72,9 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
"to create TemplateBinder instances.")]
|
||||
public TemplateBinder(
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable PUB0001
|
||||
ObjectPool<UriBuildingContext> pool,
|
||||
#pragma warning restore PUB0001
|
||||
RoutePattern pattern,
|
||||
RouteValueDictionary defaults,
|
||||
IEnumerable<string> requiredKeys,
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
[Obsolete("This constructor will be marked internal in a future release. Use the service provider to create instances of TreeRouteBuilder.")]
|
||||
public TreeRouteBuilder(
|
||||
ILoggerFactory loggerFactory,
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
#pragma warning disable CS0618, PUB0001 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> objectPool,
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
#pragma warning restore CS0618, PUB0001 // Type or member is obsolete
|
||||
IInlineConstraintResolver constraintResolver)
|
||||
{
|
||||
if (loggerFactory == null)
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
UrlMatchingTree[] trees,
|
||||
IEnumerable<OutboundRouteEntry> linkGenerationEntries,
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
#pragma warning disable CS0618, PUB0001 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> objectPool,
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
#pragma warning restore CS0618, PUB0001 // Type or member is obsolete
|
||||
ILogger routeLogger,
|
||||
ILogger constraintLogger,
|
||||
int version)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<OutputInRepoRoot>true</OutputInRepoRoot>
|
||||
<DisablePubternalApiCheck>true</DisablePubternalApiCheck>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<IsTestAssetProject>true</IsTestAssetProject>
|
||||
</PropertyGroup>
|
||||
<!-- Skip the parent folder to prevent getting test package references. -->
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\..\, Directory.Build.props))\Directory.Build.props" />
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
<PropertyGroup>
|
||||
<OutputInRepoRoot>true</OutputInRepoRoot>
|
||||
<ToolSharedSourceRoot>$(MSBuildThisFileDirectory)Shared\</ToolSharedSourceRoot>
|
||||
<DisablePubternalApiCheck>true</DisablePubternalApiCheck>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue