Macker Guide

Generating Reports

Using the Macker Report Ant Task

In addition to providing feedback directly to the console, Macker can generate nice-looking HTML reports like this one. This happens in two steps:

To generate the XML report, pass the xmlReportFile option to the Macker Ant task. (You'll probably also want to set the failOnError to false, or the build won't actually make it up to the point of formatting the report.)

<property name="macker.report.dir" location="${build.dir}/report" />
<property name="macker.report.xml" location="${macker.report.dir}/macker-report.xml" />
<property name="macker.report.html" location="${macker.report.dir}/macker-report.html" />

<macker xmlReportFile="${macker.report.xml}" failOnError="false">
    ...
</macker>

You're now ready to format the report. As with the other Ant task, you must declare it before you can use it:

<taskdef name="macker-report"
    classname="net.innig.macker.ant.MackerReportAntTask"
    classpathref="build.classpath"/>

The actual report formatting call looks something like this:

<macker-report
    xmlReportfile="${macker.report.xml}"
    outputFile="${macker.report.html}" />

Take a look at the example build file for a complete example of the two Macker tasks working together.

Parameters

These options appear on the <macker> tag itself. They are all optional.
AttributeDescriptionDefault
xmlReportFile
xmlReportUrl
The XML output of the Macker Ant task. One of these two is required. none
outputFile The file to which Macker should output the formatted HTML report. none
format
formatFile
formatUrl
An XSLT file to format the report. The format option specifies one of Macker's built-in formats (current only "html-basic" is available). The other two options specify custom XSLT instead, as a file or a URL. html-basic
skin
skinFile
skinUrl
A CSS file to control the report's appearance. The skin option specifies one of Macker's built-in skins (current "vanilla" and "maroon" are available). The other two options specify custom CSS instead, as a file or a URL. vanilla

Submissions of custom formats and skins are welcome. You can use the built-ins as starting points -- they're in the Macker distribution, under res/net/innig/macker/report.

Congratulations!

You have now completed the Macker Online Training Course. If you wish, you may print this page as evidence of your accomplishment and post it on your wall. Feel free to contact me with questions -- I'd love to know that people are interested in the project! There are even some open tasks....

SourceForge Logo        innig