You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/05/30 01:21:55 UTC

DO NOT REPLY [Bug 20344] New: - [PATCH]Allows record task to use XmlRecorder

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20344>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20344

[PATCH]Allows record task to use XmlRecorder

           Summary: [PATCH]Allows record task to use XmlRecorder
           Product: Ant
           Version: 1.6Alpha (nightly)
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: kris.bravo@corridor-software.us


Background:
Currently, Ant supports logging as XML by specifying a logger on the 
command line:

ant -logger org.apache.tools.ant.XmlLogger -verbose -logfile build_log.xml

Problem:
There are a few limits to this. The log file and listener must be specified 
on the command line instead of in property fields or a file. Also, the 
log file is produced at the end of the build, so transforms and other 
followup operations have to be performed from another build script.

Solution:
This patch modifies the record task to allow a Recorder to be specified.
XmlRecorder, a subclass of XmlLogger, is included in this patch and can be 
used to produce the XML log output. This may then be transformed from within 
the build.xml.

Documentation:
The ant Record core task's documentation is updated to reflect the change.
Listener is removed from the wishlist at the bottom of Record's html file. 
After looking into the code, I found it more appropriate to refer to the 
attribute as a recorder (sticking to the codebase' naming convention).

Example:
Here, a java compile task is recorded, and the resulting log.xml file 
is used to produce html output.

    ...
    <record name="log/log.xml" recorder="org.apache.tools.ant.XmlRecorder"
      action="start"/>
    <javac ...
    <record name="log.xml" action="stop"/>
    
    <style basedir="log/" includes="log.xml" destdir="doc/" 
      extension=".html"style="log.xsl"/>
    ...

The tar.gz attachment includes the patch, new files. See recorder.make for
the list of changed and new files.

Tests:
  The code has been tested with the XmlRecorder, no recorder, and for regression 
using the command line method. 

ToDo:
  The XmlRecorder will not add entries when the recorder is restarted. I figured 
it would be best to get this in first and learn the process 
(my first public patch ever). If restarting is needed I'll improve the code later.