As per the instructions here: https://confluence.atlassian.com/clover/gradle-clover-plugin-317950477.html , integrating clover manually, one of the steps is:
test execution - add clover.jar to the test classpath
test {
def cloverClasspath = configurations.testRuntime + configurations.cloverRuntime + sourceSets.test.output + sourceSets.clover.output
classpath = cloverClasspath
}
How does this work? I have noticed, somehow adding the clover jar in test task's classpath, pulls in cloverInstr and compileCloverJava tasks.
It most probably works because inferred task dependencies (https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:inferred_task_dependencies) in gradle.
Because `sourceSets.clover.output` is added to the classPath of the `test` task, gradle resolves it by adding a task dependency.
Generally speaking, Gradle can figure out task dependencies basing on task inputs/outputs.
Since test task depends on:
* sourceSets.test.output
* sourceSets.clover.output
Gradle knows Test task is needs to invoke testClasses (testCompile + testProcessResources) and cloverClasses first because those are the tasks which generate output of a source set.
As it goes about clover.jar. Configuration cloverRuntime contains it so test task classpath contains it as well. Nothing super fancy here ;)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.