From 12e1d5ef104bb46731511e5ed3245517be822537 Mon Sep 17 00:00:00 2001 From: Julien Lebosquain Date: Sun, 16 Jul 2023 01:58:50 +0200 Subject: [PATCH] Avoid api validation for symbol packages --- nukebuild/ApiDiffValidation.cs | 5 +++-- nukebuild/Build.cs | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/nukebuild/ApiDiffValidation.cs b/nukebuild/ApiDiffValidation.cs index bd576250bd..483bfd336a 100644 --- a/nukebuild/ApiDiffValidation.cs +++ b/nukebuild/ApiDiffValidation.cs @@ -38,7 +38,8 @@ public static class ApiDiffValidation var left = new List(); var right = new List(); - var suppressionFile = Path.Combine(suppressionFilesFolder, GetPackageId(packagePath) + ".nupkg.xml"); + var packageId = GetPackageId(packagePath); + var suppressionFile = Path.Combine(suppressionFilesFolder, packageId + ".nupkg.xml"); // Don't use Path.Combine with these left and right tool parameters. // Microsoft.DotNet.ApiCompat.Tool is stupid and treats '/' and '\' as different assemblies in suppression files. @@ -57,7 +58,7 @@ public static class ApiDiffValidation e.target == baselineDll.target && e.entry.Name == baselineDll.entry.Name); if (targetDll.entry is null) { - throw new InvalidOperationException($"Some assemblies are missing in the new package: {baselineDll.entry.Name} for {baselineDll.target}"); + throw new InvalidOperationException($"Some assemblies are missing in the new package {packageId}: {baselineDll.entry.Name} for {baselineDll.target}"); } var targetDllPath = $"target/{targetDll.target}/{targetDll.entry.Name}"; diff --git a/nukebuild/Build.cs b/nukebuild/Build.cs index b82c446249..bbfc28aa9f 100644 --- a/nukebuild/Build.cs +++ b/nukebuild/Build.cs @@ -288,7 +288,7 @@ partial class Build : NukeBuild .Executes(async () => { await Task.WhenAll( - Directory.GetFiles(Parameters.NugetRoot).Select(nugetPackage => ApiDiffValidation.ValidatePackage( + Directory.GetFiles(Parameters.NugetRoot, "*.nupkg").Select(nugetPackage => ApiDiffValidation.ValidatePackage( ApiCompatTool, nugetPackage, Parameters.ApiValidationBaseline, Parameters.ApiValidationSuppressionFiles, Parameters.UpdateApiValidationSuppression))); });