From b80ec8d5a6179548a9b1d62b9558fe4d7e2fed57 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Fri, 1 Apr 2022 19:57:16 -0700 Subject: [PATCH] Update build dependencies --- build/Build.cs | 31 +++++++++++++------------- build/CodeGen/Common.cs | 6 ++--- build/CodeGen/_buildCodeGen.csproj | 2 +- build/_build.csproj | 4 ++-- tests/LibHac.Tests/LibHac.Tests.csproj | 2 +- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/build/Build.cs b/build/Build.cs index 16076616..616c8348 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -108,16 +108,16 @@ partial class Build : NukeBuild { if (!e.Message.Contains("not a git repository", StringComparison.OrdinalIgnoreCase)) { - Logger.Error(e); + Serilog.Log.Error(e, e.Message); } } if (gitRepository == null || gitVersion == null) { - Logger.Normal("Unable to read Git version."); + Serilog.Log.Debug("Unable to read Git version."); VersionString = GetCsprojVersion(); - Logger.Normal($"Using version from .csproj: {VersionString}"); + Serilog.Log.Debug($"Using version from .csproj: {VersionString}"); return; } @@ -165,7 +165,7 @@ partial class Build : NukeBuild ["VersionSuffix"] = suffix }; - Logger.Normal($"Building version {VersionString}"); + Serilog.Log.Debug($"Building version {VersionString}"); }); Target Clean => _ => _ @@ -288,7 +288,7 @@ partial class Build : NukeBuild EnsureExistingDirectory(ArtifactsDirectory); ZipFiles(CliCoreZip, namesCore); - Logger.Normal($"Created {CliCoreZip}"); + Serilog.Log.Debug($"Created {CliCoreZip}"); PushArtifact(CliCoreZip); }); @@ -319,7 +319,7 @@ partial class Build : NukeBuild if (pwd == string.Empty) { - Logger.Normal("Skipping sign task"); + Serilog.Log.Debug("Skipping sign task"); return; } @@ -348,7 +348,7 @@ partial class Build : NukeBuild public void PrintResults() { - Logger.Normal("SHA-1:"); + Serilog.Log.Debug("SHA-1:"); using (var sha = SHA1.Create()) { foreach (string filename in Directory.EnumerateFiles(ArtifactsDirectory)) @@ -356,7 +356,7 @@ partial class Build : NukeBuild using (var stream = new FileStream(filename, FileMode.Open)) { string hash = BitConverter.ToString(sha.ComputeHash(stream)).Replace("-", ""); - Logger.Normal($"{hash} - {Path.GetFileName(filename)}"); + Serilog.Log.Debug($"{hash} - {Path.GetFileName(filename)}"); } } } @@ -391,7 +391,8 @@ partial class Build : NukeBuild EnsureExistingDirectory(ArtifactsDirectory); ZipFile(CliNativeZip, CliNativeExe, $"hactoolnet{NativeProgramExtension}"); - Logger.Normal($"Created {CliNativeZip}"); + Serilog.Log.Debug($"Created {CliNativeZip}"); + Serilog.Log.Debug($"Created {CliNativeZip}"); PushArtifact(CliNativeZip); } @@ -530,12 +531,12 @@ partial class Build : NukeBuild if (!File.Exists(path)) { - Logger.Warn($"Unable to add artifact {path}"); + Serilog.Log.Warning($"Unable to add artifact {path}"); } appVeyor.PushArtifact(path, name); - Logger.Normal($"Added AppVeyor artifact {path}"); + Serilog.Log.Debug($"Added AppVeyor artifact {path}"); } public static void ReplaceLineEndings(string filename) @@ -565,7 +566,7 @@ partial class Build : NukeBuild AbsolutePath coreFxDir = TempDirectory / ("sign_" + Path.GetFileName(CliCoreZip)); AbsolutePath nativeZipDir = TempDirectory / ("sign_" + Path.GetFileName(CliNativeZip)); - bool signNative = FileExists(CliNativeExe); + bool signNative = CliNativeExe.FileExists(); try { @@ -647,7 +648,7 @@ partial class Build : NukeBuild public void RunCodegenStage2() { - Logger.Normal("\nBuilding stage 2 codegen project."); + Serilog.Log.Debug("\nBuilding stage 2 codegen project."); DotNetRunSettings settings = new DotNetRunSettings() .SetProjectFile(CodeGenProject.Path); @@ -656,11 +657,11 @@ partial class Build : NukeBuild try { DotNetRun(settings); - Logger.Normal(); + Serilog.Log.Debug(""); } catch (ProcessException) { - Logger.Error("\nError running stage 2 codegen. Skipping...\n"); + Serilog.Log.Error("\nError running stage 2 codegen. Skipping...\n"); } } } \ No newline at end of file diff --git a/build/CodeGen/Common.cs b/build/CodeGen/Common.cs index 5c25c792..e7cac139 100644 --- a/build/CodeGen/Common.cs +++ b/build/CodeGen/Common.cs @@ -67,11 +67,11 @@ public static class Common if (oldFile?.SequenceEqual(newFile) == true) { - Logger.Normal($"{relativePath} is already up-to-date"); + Serilog.Log.Debug($"{relativePath} is already up-to-date"); return; } - Logger.Normal($"Generated file {relativePath}"); + Serilog.Log.Debug($"Generated file {relativePath}"); File.WriteAllBytes(fullPath, newFile); } @@ -105,4 +105,4 @@ public static class Common return Path.Combine(currentDir, "src"); } -} +} \ No newline at end of file diff --git a/build/CodeGen/_buildCodeGen.csproj b/build/CodeGen/_buildCodeGen.csproj index 1da37816..0e159e79 100644 --- a/build/CodeGen/_buildCodeGen.csproj +++ b/build/CodeGen/_buildCodeGen.csproj @@ -17,7 +17,7 @@ - + diff --git a/build/_build.csproj b/build/_build.csproj index fcf53886..77b9740d 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -13,10 +13,10 @@ - + - + diff --git a/tests/LibHac.Tests/LibHac.Tests.csproj b/tests/LibHac.Tests/LibHac.Tests.csproj index 6c4ff547..fbd978b1 100644 --- a/tests/LibHac.Tests/LibHac.Tests.csproj +++ b/tests/LibHac.Tests/LibHac.Tests.csproj @@ -8,7 +8,7 @@ - +