From 59c883b6f80e2234d6fe4652e91c47864b7b9511 Mon Sep 17 00:00:00 2001 From: Michiel Oda Date: Fri, 28 Jul 2023 10:50:51 +0200 Subject: [PATCH] Update CICD NuGet with fix for slow package creation --- .../Package.Builder/Package.Builder.csproj | 2 +- .../Package.Builder/PackageBuilder.cs | 24 ++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/GitHubAction/Package.Builder/Package.Builder.csproj b/GitHubAction/Package.Builder/Package.Builder.csproj index 8d4ce3e..ad3467d 100644 --- a/GitHubAction/Package.Builder/Package.Builder.csproj +++ b/GitHubAction/Package.Builder/Package.Builder.csproj @@ -9,7 +9,7 @@ - + diff --git a/GitHubAction/Package.Builder/PackageBuilder.cs b/GitHubAction/Package.Builder/PackageBuilder.cs index d4249fd..f5b9020 100644 --- a/GitHubAction/Package.Builder/PackageBuilder.cs +++ b/GitHubAction/Package.Builder/PackageBuilder.cs @@ -14,13 +14,16 @@ public class GitHubActionLogger : ILogCollector { - public IList Logging { get; } + private readonly List _logging; + private readonly IPackagePresenter _presenter; + + public IReadOnlyList Logging => _logging.ToList(); + public bool HasError { get; private set; } - private IPackagePresenter _presenter; public GitHubActionLogger(IPackagePresenter presenter) { - Logging = new List(); + _logging = new List(); HasError = false; _presenter = presenter; } @@ -28,20 +31,25 @@ public GitHubActionLogger(IPackagePresenter presenter) public void ReportError(string error) { HasError = true; - Logging.Add("ERROR: " + error); + _logging.Add("ERROR: " + error); } public void ReportStatus(string status) { - Logging.Add("STATUS: " + status); + _logging.Add("STATUS: " + status); } public void ReportWarning(string warning) { - Logging.Add("WARNING: " + warning); - } + _logging.Add("WARNING: " + warning); + } + + public void ReportLog(string message) + { + _logging.Add(message); + } - public void SendToPresenter() + public void SendToPresenter() { foreach (var line in Logging) {