ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Proposal: XML output from ant tasks
Date Fri, 25 Feb 2000 02:57:18 GMT

duncan wrote:
> the end goal is to reduce clutter out to the user when running

costin wrote:
> The end goal is allow post-processing

<obscure refid="#SNL">
  It's a floor wax &amp; a desert topping!

Logs are typically linear.  If we are contemplating XML, then we should
think hierarchical.  Each target should produce exactly one XML element,
with each task producing a single nested XML element with potentially more
data nested therein.  There should be methods to create a Node, insert a
child node, get a list of child nodes, set an attribute on a Node.  In
short a DOM.  More specifically, the w3c DOM.

So, the log facility is a simple XML document, which is constructed by the
various tasks, and dumped to a log file at the end of the run.  Slightly
overkill, but easy to implement.

Now lets see if we can simplify it a bit.

We can certainly make the superclass of all Tasks construct the default
node for the task, and populate its attributes by introspecting the object
at execution time.  (Actually, since this requires us to write getters a
lazier approach would be to modify the ProjectHelper).

We could also define a few convenience methods construct and insert simple
elements with zero, one, or two attributes.  These convenience methods
could also choose to optionally write this information to System.out in a
convenient and easy to read format.

Simple to implement, easy to use, and powerful.

- Sam Ruby

View raw message