Class DiagnosticNote
- All Implemented Interfaces:
ExtensionPoint
,Describable<ConsoleNote<?>>
,Serializable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class hudson.console.ConsoleNote
INSECURE, POSTAMBLE, POSTAMBLE_STR, PREAMBLE, PREAMBLE_STR
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionannotate
(Object context, MarkupText text, int charPos) static boolean
Scans a line of text to determine whether it would be styled by this note.Methods inherited from class hudson.console.ConsoleNote
encode, encodeTo, encodeTo, findPreamble, getDescriptor, readFrom, removeNotes, removeNotes, skip
-
Constructor Details
-
DiagnosticNote
public DiagnosticNote()
-
-
Method Details
-
annotate
- Specified by:
annotate
in classConsoleNote<Object>
-
appliesTo
Scans a line of text to determine whether it would be styled by this note.- Parameters:
text
- The text to scan.- Returns:
true
iftext
contains a diagnostic line;false
otherwise.
-