Skip validation of assembly version attributes for global CLI tool packages
This commit is contained in:
Родитель
ed36468bf3
Коммит
274c65868e
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using NuGet.Packaging.Core;
|
||||
|
||||
namespace NuGetPackageVerifier
|
||||
{
|
||||
public class Constants
|
||||
{
|
||||
public static PackageType DotNetTool = new PackageType("DotnetTool", PackageType.EmptyVersion);
|
||||
}
|
||||
}
|
|
@ -14,11 +14,9 @@ namespace NuGetPackageVerifier.Rules
|
|||
{
|
||||
private const string ToolManifestFileName = "DotnetToolSettings.xml";
|
||||
|
||||
private static PackageType DotNetTool = new PackageType("DotnetTool", PackageType.EmptyVersion);
|
||||
|
||||
public IEnumerable<PackageVerifierIssue> Validate(PackageAnalysisContext context)
|
||||
{
|
||||
if (!context.Metadata.PackageTypes.Any(p => p == DotNetTool))
|
||||
if (!context.Metadata.PackageTypes.Any(p => p == Constants.DotNetTool))
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
|
@ -28,7 +26,7 @@ namespace NuGetPackageVerifier.Rules
|
|||
|
||||
if (packageFiles == null || manifests.Count() == 0)
|
||||
{
|
||||
yield return PackageIssueFactory.DotNetToolMustHaveManifest(DotNetTool.Name, ToolManifestFileName);
|
||||
yield return PackageIssueFactory.DotNetToolMustHaveManifest(Constants.DotNetTool.Name, ToolManifestFileName);
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,12 @@ namespace NuGetPackageVerifier.Rules
|
|||
{
|
||||
public IEnumerable<PackageVerifierIssue> Validate(PackageAnalysisContext context)
|
||||
{
|
||||
if (context.Metadata.PackageTypes.Any(p => p == Constants.DotNetTool))
|
||||
{
|
||||
// Skip for dotnet global tool packages which contain assemblies from other teams and projects
|
||||
yield break;
|
||||
}
|
||||
|
||||
AssemblyAttributesDataHelper.SetAssemblyAttributesData(context);
|
||||
foreach (var assemblyData in context.AssemblyData)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче