Regarding the xml structure, there's 2 things on my mind
- Try not to change the existing structure too much unless we have to
- This problem with exceptions is actually about failures generally (I've tried using just a <fail /> with a message and the same behaviour manifests - you never actually get the failure message in the xml)
With this in mind, lets look at the following script:
<project name="example" default="okthenfail"> <target name="okthenfail" depends="ok, fail" />
<target name="ok"> <echo message="This is OK" /> </target>
<target name="fail"> <fail message="This is a failure" /> </target> </project>
Currently this produces the following output (for the the 'okthenfail' target) for plain and xml outputs:
-- Buildfile: file:///C:/tools/eclipse/workspace/ccnet/temp.build Target(s) specified: okthenfail
ok:
[echo] This is OK
fail:
BUILD FAILED
C:\tools\eclipse\workspace\ccnet\temp.build(9,5): This is a failure
Total time: 0.2 seconds.
--
<buildresults project="example">
<message level="Info"><![CDATA[Buildfile: file:///C:/tools/eclipse/workspace/ccnet/temp.build]]></message>
<message level="Info"><![CDATA[Target(s) specified: okthenfail]]></message>
<target name="ok">
<task name="echo">
<message level="Info"><![CDATA[This is OK]]></message>
</task>
</target>
<target name="fail">
<task name="fail" />
</target>
</buildresults>
--
The thing I get from this is that what we are losing is the failure message we have from the plain output and this failure message is reported outside of any targets or tasks. My suggestion is therefore that we simply add a <failure> tag, so that the xml looks like:
<buildresults project="example">
<message level="Info"><![CDATA[Buildfile: file:///C:/tools/eclipse/workspace/ccnet/temp.build]]></message>
<message level="Info"><![CDATA[Target(s) specified: okthenfail]]></message>
<failure>
<location><![CDATA[C:\tools\eclipse\workspace\ccnet\temp.build(9,5)]]></location>
<message><![CDATA[This is a failure]]></message>
</failure>
<target name="ok">
<task name="echo">
<message level="Info"><![CDATA[This is OK]]></message>
</task>
</target>
<target name="fail">
<task name="fail" />
</target>
</buildresults>
Optionally, it would be nice to add an attribute to the 'buildresults' root tag called 'success' that is either "true" or "false".
It would also be good to introduce a <time units="seconds"> tag, that could be used both underneath the top level to indicate the time for the whole build, and maybe also for each target to show how long each target takes.
What do you think?
Cheers,
Mike
Gert Driesen wrote:
Mike,
This is a known issue (http://sourceforge.net/tracker/index.php?func=detail&aid=788650&group_id=31 650&atid=402868), which is probably very easy to fix. But I was actually waiting for a good proposal for the xml structure.
Taken from the existing bug report :
"Currently the layout of the xml logger output is something like this :
<buildresults project="..."> <message level="Info">....</message> <target name="..."> <task name="..."> .... </task> </target> </buildresults>
we could rename the "buildresults" node to "build", and add a result node under that node with a status attribute (with possible values "failure" or "success") and output the details of the build failure as content of that node.
eg.
<build project="..."> <result status="Failure"> Unable to .... </result> </build>"
Can you propose something, then I'll implement it. Does that sound ok ? :-)
Gert
------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Nant-users mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/nant-users