-
New Feature
-
Resolution: Unresolved
-
Minor
-
Windows 2012 Server, Jenkins running as Service. Jenkins 1.621, Chrome 44.0.2403.125m (64 bit)
I've been trying to get this plugin to work for msbuild output but I've been unable to figure out a set of options that would work. If it IS possible to do this already, could someone provide step by step instructions. If not, would you consider this in the future?
[JENKINS-29758] Please support msbuild output.
Workflow | Original: JNJira [ 164833 ] | New: JNJira + In-Review [ 181704 ] |
I don't think MSBuild itself supports outputting the SGR control sequences that ansicolor-plugin would recognize. The Microsoft.Build.Logging.ConsoleLogger class only sets Console.ForegroundColor or Console.BackgroundColor, and the .NET Framework on Windows implements those by calling SetConsoleTextAttribute, not by outputting characters.
If you were running MSBuild on .NET Core Framework on Unix, then the System.Console class would output SGR control sequences, and it should just work.
I think you can implement it on Windows by deriving a custom logger class from Microsoft.Build.Logging.ConsoleLogger, making its constructor call the ConsoleLogger(LoggerVerbosity, WriteHandler, ColorSetter, ColorResetter) constructor with delegates that output the SGR control sequences, and passing the name of the custom logger class to the MSBuild.exe /logger option.