Print severity for scala compile issue

(Iacopo) #1

I’m using gradle 4.10.2 to compile our scala project.
I enabled compiler warnings in the hope to get meaningful warnings using the warnings plugin in jenkins.

The problem in doing this is that the format used by gradle to output scala errors/warnings hides really well the severity of the message, making it really hard to parse the error messages.

For instance this is a compile error:

> Task :compilePlayBinaryScala
Pruning sources from previous analysis, due to incompatible CompileSetup.
<fileUrl>:35: not found: type Loggers
trait AuthHelper extends Loggers {
<fileUrl>:112: not found: value warning
        warning("Warning message")
two errors found

Similarly, warnings have the same exact format, but the last line reports
two warnings found

If I use “–debug” then gradle will output the severity level for each an every line, but that makes the build console almost unreadable… Is there an easy way to prepend severity level for all/a tasks’s log lines in gradle?
Or can you think of any other way to print an easily parsable error/warning compile message using gradle?