JacocoReport skipped when destinationPath used


(Wagner Michael) #1

Gradle Version: 2.14
Operating System: Linux
Is this a regression? If yes, which version of Gradle do you know it last worked for?

This is how my build.gradle looks (simplified):

apply plugin: 'jacoco'
jacoco {
    toolVersion = jacocoVersion

task integTest(type: Test, group: 'verification') {
    jacoco {
        append = false
        destinationFile = file("$buildDir/tmp/jacoco/jacocoTest.exec")
        classDumpFile = file("$buildDir/tmp/jacoco/classpathdumps")

    testClassesDir = sourceSets.integTest.output.classesDir
    classpath = sourceSets.integTest.runtimeClasspath

    reports.html.destination = file("$reports.html.destination/integ")
    reports.junitXml.destination = file("$reports.junitXml.destination/integ")

task jacocoIntegTestReport(type: JacocoReport, group: 'other') {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination "${buildDir}/reports/jacoco/integ"
    executionData integTest
    sourceSets sourceSets.main

This works in 2.13. There is a jacocoTest.exec being generated under build/tmp/jacoco.
In 2.14 the jacocoTest.exec is generated under build/jacoco (ignoring my destinationFile path), which then results in a skipped jacocoIntegTestReport Task. If i delete the destinationFile = file("$buildDir/tmp/jacoco/jacocoTest.exec") line from the Extension everything works fine, with the exec file being generated under build/jacoco thought.

(Wagner Michael) #2

In the Jacoco Plugin UserGuide of Gradle 2.14 there is a destPath mentioned, which i would have used there to override that path, thought i can’t use that, because its not a property of JacocoTaskExtension. Is this intended ?
If yes, why is it then mentioned under Table 61.2. Default values of the JaCoCo Task extension

(David Frank) #3

I also noticed this when going from 2.12 to 2.14. Also had it at tmp/jacoco previously. But I can live with the new location - so it doesn’t hurt me.

(Stefan Wolf) #4

Thank you for reporting. This will be fixed in 2.14.1-rc-2. See GRADLE-3498.