Cleanup cake process logging (#1293)

This commit is contained in:
Charles Gagnon
2021-11-10 16:44:54 -08:00
committed by GitHub
parent c81a400752
commit c738e3bdf7
2 changed files with 23 additions and 24 deletions

View File

@@ -220,14 +220,17 @@ Task("BuildTest")
{
var project = pair.Key;
var projectFolder = System.IO.Path.Combine(testFolder, project);
var runLog = new List<string>();
Run(dotnetcli, $"build --framework {framework} --configuration {testConfiguration} \"{projectFolder}\"",
var logPath = System.IO.Path.Combine(logFolder, $"{project}-{framework}-build.log");
using (var logWriter = new StreamWriter(logPath)) {
Run(dotnetcli, $"build --framework {framework} --configuration {testConfiguration} \"{projectFolder}\"",
new RunOptions
{
StandardOutputListing = runLog
StandardOutputWriter = logWriter,
StandardErrorWriter = logWriter
})
.ExceptionOnError($"Building test {project} failed for {framework}.");
System.IO.File.WriteAllLines(System.IO.Path.Combine(logFolder, $"{project}-{framework}-build.log"), runLog.ToArray());
}
}
}
});