Hello, I use Cruise Control (CC) for continuous integration. CC uses Ant-XMLLogger. The CC-Webapp parses the the output of the logging to display compile-errors and warnings in the browser. I want to seperate compile errors and warnings but there is no way to see differences between javac errors and warnings in the xml-output: All looks like: ---------------- <message priority="warn">...</message> (cruise control output and commandline output looks the same) What I expect is: ----------------- <message priority="error">...</message> for errors The compile is delegated to another build script: build.xml --> compile.xml (<javac>-Task in there) (Maybe some important hint) Output of a test-project: ------------------------- <message priority="warn"> <![CDATA[D: Projekte\CVS_CruiseControl\dev\Implementierung\Thunderbird\ThunderbirdCore\Prod \de\sparkasseninformatik\thunderbird\sk\hallo\HalloBegruesser.java:12: ';' expected]]> </message> <message priority="warn"> <![CDATA[ return "Hallo, " + input]]> </message> <message priority="warn"> <![CDATA[ ^]]></message> <message priority="warn"> <![CDATA[1 error]]> </message> regards, Christian
The problem is, that Ant doesn't know what javac is talking about. What you see in Ant's logfile is the literal System.err (or .out, can't remember) of javac and there is no way for Ant to tell warnings from errors (given the pluggable compiler implementations, things are even more complicated).
I've also wished Ant (and thus the XML logger) would be able to differentiate between warning (like deprecations), and real errors. We currently have projects with tons of deprecation warning, so finding the one or two errors among them is a real chore. Even though there is the pluggeable compiler architecture, error messages that contain the word warning after a line number should be doable, controlled by a new attribute of course. Not that I'm volunteering of course ;-) --DD
Well, you know that warnings a span multiple lines, don't you?
True, but you can negate the search, and at least put the first line of every error (no warning string follows the filename.java:123: pattern) on stderr, and hopefully they could then latter be styled differently... I know, it's a little farfetch though. --DD