ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Sheward" <>
Subject XmlLogger, BuildEvents and Exceptions
Date Thu, 12 Dec 2002 00:06:23 GMT

I use Ant 1.5 with CruiseControl 2.0.1 and wanted to get more information
when a build fails. CruiseControl uses the XML output from Ant and in
particular the /build/stacktrace element to determine the cause of a failed
build. I wanted to see the project, target and task too.

I made some modifications to the buildFinished() method in XmlLogger where
it wrote the stacktrace to write the project name, target name and task name
associated with the event if it included an exception, but it only ever
filled out the project name. I added similar code so that the
targetFinished() method would embed its own stacktrace and then I get two
copies of the stacktrace element, one under build and the new one under
target with the project name and target name. Again, I added similar code to
the taskFinished() method and now I get three stacktrace elements and the
one under task showed with the project name, target name and task name.

So either the information is removed from the BuildEvent object or a new
object is created. I added an attribute containing the hash of the
BuildEvent object and it seems that a new object is being created each time.

So a couple of questions:

Does it make any sense to have multiple stacktrace elements in a single XML
log file, or will one exception be guaranteed to halt the build?

If one exception is guaranteed to halt the build, is there anyway that I can
get this information into the stack element beneath the top level object
nicely? I thought of making exception null after writing the details but
that would involve making exception public or adding a setException() method
to BuildEvent, neither of which seem like nice options, or perhaps a
clearException() method that would just set the value to null.

I haven't included code examples or XML examples here, but I would be happy
to supply them upon request and contribute the code once I've solved this

Any advice would be appreciated,


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message