You can share report formats across a number of reports. This allows you to standardize on a set of report formats and use these for all of your reports.
Standalone format elements are created using the
<clover-format> type. These standalone types support the same attributes and elements as the internal <format> elements of the
<clover-report> task. To name the format, use the standard Ant "id" attribute.
The following code declares two report formats:
In this example, the first format is for source level, PDF reports. It is named "
std.format". The second format, "
bw.format", is essentially the same except that it specifies black-and-white output.
Once the format is declared with an identifier, it can be used by reference with a "
refid" attribute. This is shown in the following report example:
This report, a summary report, uses the "
std.format" format defined above. The
refid values in the
<format> elements can be an Ant property allowing selection of the report format at build time. The following is a complete example:
This example generated two reports, which share a format. The format defaults to the standard format, a color report. This default can be overriden from the command line. To generate black-and-white reports, use: