To get Clover 2 integrated into your build as quickly as possible, follow these simple steps.
These instructions require Ant 1.7 or later.
- Download the clover.jar and save it in your home directory.
- Add the following lines to your build.xml file:
Note that this will not work within an Ant target. It must be at the top level of the build file.
- Add the clover.jar to your test-time classpath:
- The following targets will then be available to you:
These are available also by running `ant -projecthelp`.
Target Name
Description
clover.all
Runs clover.clean, with.clover, test, clover.report from a single target.
clover.clean
Deletes the clover database and the
directory.
clover.current
Generates an HTML and XML report to
using
.
clover.report
Same as clover.current, however a history report will also be created, using the historypoints in
.
clover.save-history
Saves a history point to
with.clover
Enables Clover on this build
clover.snapshot
Saves a snapshot file to assist with unit test optimization
For more instructions about using targets, see the Clover Target Reference.
Any ${} properties may be defined on the command line, for example:
- If you have a target already called "test" you can simply run
Otherwise, run the following:
Alternatively, define a property called "test.target" whose value is the name of your test target.
Complete!
That concludes the Ant two-line integration. You should now be set up to run Clover on your Ant builds and start taking advantage of Clover's advanced code coverage analysis.
Need more information? Find it in the Clover QuickStart Guide. |






