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?
Please see this issue here, which describes the same problem: http://issues.gradle.org/browse/GRADLE-2764
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.
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.
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.