[GRADLE-2960] JacocoReport tasks don't have dependencies on tasks that produce coverage data Created: 20/Nov/13  Updated: 09/May/14  Resolved: 09/May/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Task
Reporter: Gradle Forums Assignee: Szczepan Faber
Resolution: Won't Fix Votes: 0


 Description   

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]([1]https://github.com/gradle/gradle/comm...) 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?
----------------------------------------------------------------------------------------
[1] https://github.com/gradle/gradle/commit/971f7815d55103aaed979c50620800b9abd911d6



 Comments   
Comment by Gradle Forums [ 20/Nov/13 ]

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

Comment by Gradle Forums [ 20/Nov/13 ]

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.

Comment by Gradle Forums [ 20/Nov/13 ]

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.
Comment by Gradle Forums [ 20/Nov/13 ]

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.

Comment by Szczepan Faber [ 09/May/14 ]

We haven't reached a consensus about this story. I believe that we should use dependsOn, Adam prefers the current state of things (mustRunAfter) and we haven't got any other votes

We are not planning on changing this behavior at the moment hence I'm closing this ticket. Feel free to comment or chip in to the discussion on the dev list.

Generated at Wed Jun 30 12:36:04 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.