Plugin to use the Jacoco coverage tool in your Java builds
Just declare the plugin in your build class.
@JkDefClasspath("dev.jeka.plugins:protobuf:[version]")
public class Build extends JkClass {
JkPluginJava javaPlugin = getPlugin(JkPluginJava.class);
JkPluginJacoco jacoco = getPlugin(JkPluginJacoco.class);
...
}
The plugin will configure java project in such tests are launched with jacoco agent. Jacoco reports are output in output/jacoco dir.
You can use directly JkJacoco
in build code to perform lower level actions.
You can invoke Jacoco plugin from command line on a Jeka project that does declare this plugin in its build class.
jeka @dev.jeka.plugins:jacoco:[version] jacoco# java#pack
To get help and options :
jeka jacoco#help
See example here
This project uses Jeka wrapper, you don't need to have Jeka installed on your machine. simply execute ./jekaw cleanPack
from the root of this project.