JacocoReport tasks don't have dependencies on tasks that produce coverage data


(andrew.oberstar) #1

I noticed today that the JacocoReport tasks use ‘mustRunAfter’ ordering rules instead of task dependencies for the ‘executionData’ added via a task. Here’s the commit where it was changed.

‘mustRunAfter’ only makes sense when the task can be run in a meaningful way without the other task’s output. What good is a Jacoco report to me if I don’t have any data in it?


(Erik Pragt) #2

Please see this issue here, which describes the same problem: http://issues.gradle.org/browse/GRADLE-2764


(Luke Daley) #3

Andrew,

The idea is that you can generate coverage for a subset of tasks. This means you need to specify which coverage producing tasks to run, and the report task.


(andrew.oberstar) #4

How common is that use case? Just from my experience: - Most projects only have one coverage producing task. - I would rarely have a need for an ad-hoc combination of tasks to produce a coverage report.


(Luke Daley) #5

Unsure.

I’m assuming that the current situation is an interim step until we get finalizers. In that case you will just run the coverage producing task(s) that will be finalized by the report task. Finalizers may be in 1.7.