Skip to content

Commit

Permalink
Run tests after compile, suppress warnings from test
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanctech committed Dec 26, 2024
1 parent 748cd96 commit 89d4711
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions build/DalamudBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.MSBuild;
using Serilog;
using Serilog.Events;

[UnsetVisualStudioEnvironmentVariables]
public class DalamudBuild : NukeBuild
Expand Down Expand Up @@ -114,8 +113,8 @@ public class DalamudBuild : NukeBuild
s = s
.SetProjectFile(DalamudProjectFile)
.SetConfiguration(Configuration)
.SetProcessArgumentConfigurator(a => a.Add("/clp:NoSummary"))
.EnableNoRestore();
.EnableNoRestore()
.SetProcessArgumentConfigurator(a => a.Add("/clp:NoSummary"));

// We need to emit compiler generated files for the docs build, since docfx can't run generators directly
// TODO: This fails every build after this because of redefinitions...
Expand Down Expand Up @@ -170,22 +169,10 @@ public class DalamudBuild : NukeBuild
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console(outputTemplate: ConsoleTemplate) //Conditional(c => AllowMessage(c), wt => wt.
.WriteTo.Console(outputTemplate: ConsoleTemplate)
.CreateLogger();
});

private static readonly HashSet<string> MessageBuffer = [];
private static bool AllowMessage(LogEvent e)
{
if (e.Level == LogEventLevel.Warning && MessageBuffer.Contains(e.MessageTemplate.Text))
{
Log.Debug($"Suppressing duplicate message: {e.MessageTemplate.Text.Replace("warning","dupwarn")}");
return false;
}
MessageBuffer.Add(e.MessageTemplate.Text);
return true;
}

Target Compile => _ => _
.DependsOn(CompileDalamud)
.DependsOn(CompileDalamudBoot)
Expand All @@ -201,7 +188,7 @@ private static bool AllowMessage(LogEvent e)
DotNetTasks.DotNetTest(s => s
.SetProjectFile(TestProjectFile)
.SetConfiguration(Configuration)
.SetNoBuild(true)
.AddProperty("WarningLevel", "0")
.EnableNoRestore());
});

Expand Down

0 comments on commit 89d4711

Please sign in to comment.