Class DiagnosticNote

java.lang.Object
hudson.console.ConsoleNote<Object>
io.jenkins.plugins.dotnet.console.DiagnosticNote
All Implemented Interfaces:
ExtensionPoint, Describable<ConsoleNote<?>>, Serializable

public final class DiagnosticNote extends ConsoleNote<Object>
A console note that applies styling to diagnostic messages (warnings and errors) in the output of .NET commands.

The detection is not exhaustive since not all .NET commands use clear markers for these messages. In addition, it currently uses hardcoded 'error' and 'warning' strings, so if the node has a non-English language configured, the decoration will likely fail.

A better approach might be to create a custom MSBuild logger which would emit special markers, which this scanner could then replace by the appropriate code. That would even allow clear marking of other things, like targets being executed. However, the question then is how to get and where to store that logger; plus, it needs to be specifically activated, so it would only be used by the builders, not the wrapper.

In the shorter term, it may be enough to have a few well-known alternatives for 'error' and 'warning', but assumptions about message format and word order may still cause problems.

See Also:
  • Constructor Details

    • DiagnosticNote

      public DiagnosticNote()
  • Method Details

    • annotate

      public ConsoleAnnotator annotate(@NonNull Object context, MarkupText text, int charPos)
      Specified by:
      annotate in class ConsoleNote<Object>
    • appliesTo

      public static boolean appliesTo(@NonNull String text)
      Scans a line of text to determine whether it would be styled by this note.
      Parameters:
      text - The text to scan.
      Returns:
      true if text contains a diagnostic line; false otherwise.