Clover AspectJ Compiler

This plugin is not supported by Atlassian.

Installation

Download the following binaries:

This integration was tested against: Clover 4.1.1 + Clover AspectJ Compiler 0.8.0 + AspectJ 1.8.9.

Find your Clover license key or request an evaluation key on the my.atlassian.com page.

Usage

Compile the code with Clover

Clover AspectJ Compiler (CloverAJC) is a wrapper over the AspectJ Compiler (AJC) command line tool. You can pass any standard ajc parameters as well as additional options exclusive for Clover, such as:

  • --initstring <path/to/clover.db>  - location of the Clover database (default is ".clover/clover.db")
  • --instrlevel (method/statement) - detail level of instrumentation (default is "statement")
  • --encoding <charset> - character encoding used (uses a system encoding by default)

To run the CloverAJC:

  • declare Clover, Clover AspectJ Compiler and AspectJ on the class path
  • ensure that Clover license key will be found - you can just add -Dclover.license.path=/path/to/clover.license option
  • run com.atlassian.clover.instr.aspectj.CloverAjc class
  • pass any options required by ajc - typically a list of files to be compiled and output directory
  • optionally pass Clover-related options

Example:

java -cp "clover.jar:clover-aspectj-compiler.jar:aspectjrt.jar:aspectjtools.jar" -Dclover.license.path=clover.license com.atlassian.clover.instr.aspectj.CloverAjc -d <output directory> <list of files>

Run the code

Run the code as usual. Just ensure that Clover JAR is present in the class path.

While running the code, Clover will write coverage recording files to the folder where Clover database was created during compilation.

Generate coverage reports

You can use any Clover integration to generate reports (Ant, Maven etc). One of the easiest ways is to use the HtmlReporter command line tool, for example:

java -cp "clover.jar" -Dclover.license.path=clover.license com.atlassian.clover.reporters.html.HtmlReporter -i .clover/clover.db -o target/report -a -e

 

Source code

Repository

This plugin is open source. You can clone the Mercurial repository from Bitbucket, e.g:

hg clone https://bitbucket.org/atlassian/clover-aspectj-compiler

Feel free to contribute! 

Examples

In the src/test/resources folder you will find a sample project with an Ant build.xml script.

Troubleshooting

This plugin has been created during Atlassian ShipIt days. Atlassian does not provide technical support for this plugin.

You can ask questions on our community forum - answers.atlassian.com.

You can report bugs and feature requests (hoping that some good soul will fix it) in the issue tracker on Bitbucket.

 

Last modified on Jan 9, 2017

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.