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.
Created attachment 6562 [details] Patch file and new files in tar.gz
Created attachment 14401 [details] Changed source files A few people have shown some interest in my change, so I've updated it for the ANT_162 tag. Since I appear to have botched the first patch I attached, I've simply attached the changes files this time. Note: This change implements the following from the wish list on the CoreTasks/Recorder.html page: listener A classname of a build listener to use from this point on instead of the default listener.
This patch request has now past the three year mark. I'm not sure what the outcome has been of other patches but to anyone looking for this type of functionality I'd recommend moving from ant to Maven 2. http://maven.apache.org Also, continuum (same site) handles automated builds well. No more updates on this patch will be done.
I'm sorry your experience has been negative. It can be hard to get patches noticed if you don't nag the right people and find a committer who is interested enough to push them through. I am reopening this because I didn't see any reason other than your disgust that this patch couldn't go in in one form or another... unless you are actually rescinding the IP grant you made when you closed the issue report. -Matt
especially with ~400 outstanding enchancement requests
I'm not rescinding the offer, but did want to create a pointer if someone was looking for this type of behavior from a build tool. I assumed that eventually all patches get either merged, rejected or overcome by events. This patch is getting closer to the latter given the timeframe. The comment on the ticket is to keep folks from hitting a dead end. As for nagging someone to roll it in, I suppose I should have. In Maven's case, I became a committer on the plugins project to avoid this type of situation.