From f9f6a7ec120defecfc15b29e66f94f7f04fd41fa Mon Sep 17 00:00:00 2001 From: Patrick Garcia Date: Wed, 28 Feb 2024 13:08:31 +0100 Subject: [PATCH] feat: expose LicenseUrl in output --- src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs | 2 ++ src/NuGetUtility/LicenseValidator/LicenseValidator.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs b/src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs index 3192cc79..661cb234 100644 --- a/src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs +++ b/src/NuGetUtility/LicenseValidator/LicenseValidationResult.cs @@ -9,12 +9,14 @@ public record LicenseValidationResult(string PackageId, INuGetVersion PackageVersion, string? PackageProjectUrl, string? License, + string? LicenseUrl, LicenseInformationOrigin LicenseInformationOrigin, List? ValidationErrors = null) { public List ValidationErrors { get; } = ValidationErrors ?? new List(); public string? License { get; set; } = License; + public string? LicenseUrl { get; set; } = LicenseUrl; public LicenseInformationOrigin LicenseInformationOrigin { get; set; } = LicenseInformationOrigin; } } diff --git a/src/NuGetUtility/LicenseValidator/LicenseValidator.cs b/src/NuGetUtility/LicenseValidator/LicenseValidator.cs index e08e0f7c..c2e57447 100644 --- a/src/NuGetUtility/LicenseValidator/LicenseValidator.cs +++ b/src/NuGetUtility/LicenseValidator/LicenseValidator.cs @@ -79,6 +79,7 @@ private void AddOrUpdateLicense( info.Identity.Version, info.ProjectUrl?.ToString(), license, + info.LicenseUrl?.AbsoluteUri, origin, new List { error }); result.AddOrUpdate(new LicenseNameAndVersion(info.Identity.Id, info.Identity.Version), @@ -97,6 +98,7 @@ private void AddOrUpdateLicense( info.Identity.Version, info.ProjectUrl?.ToString(), license, + info.LicenseUrl?.AbsoluteUri, origin); result.AddOrUpdate(new LicenseNameAndVersion(info.Identity.Id, info.Identity.Version), newValue,