Every single team might be interested about what happened to the source code of the application they are working on. Personnaly, I am willing to receive a mail every time a teammate commits anything to the repository. I know most people won't follow me on that one so here is a compromise: what about generating a summary of the CVS activity of the team every day?

Sounds good right? Ant has a very nice changelog task which is able to generate an XML file with the log of a given period, on a given module. For instance, the following target generates the changelog of today's commits:

XML:

Note that you need to run this command from a valid sandbox (refered by the sandbox.dir property). Note also that ant is able to map a user id to a full name using nested user elements. Now we have the XML, we need to transform it to a more visual content (using XSL for instance). Again, ant is a very nice tool since it provides a default stylesheet, located in $ANT_HOME/etc/changelog.xsl. The following ant target transforms our XML file into an HTML file that we can publish on a web site for instance:


<style>
out="${output.html.file}"
style="${xsl.file}">

<param name="title" expression="${changelog.title}"></param>
<param name="module" expression="${module.name}"></param>
<param name="viewcvs" expression="${viewcvs.url}"></param>         </style>

Noticed the viewcvs parameter? Actually, the default stylesheet is able to generate an url to a cvsweb repository but it is really easy to update it to ViewCVS. By the way, the ViewCVS project has been renamed to ViewVC (an upgrade of ViewCVS which is able to browse both a CVS and a Subversion repository). Finally, we can send our changelog every day by mail using the following target:


mailhost="${mail.host}"
subject="${changelog.mail.title}">

mimetype="text/html"
charset="ISO-8859-1"/>

That's it! Check also a simple example (note that the viewcvs url does not work since it maps to the wrong instance). You need optional tasks to perform this (namely XalanLiaison, available with trax ant task).

If you are an XSL guru and have a nice stylesheet to share, let us know.