Jacoco merging results of dependent projects


(Martin Lemanski) #1

Hi there,

I’m trying to merge results of two projects in the project, where I’m running the task jacocoTestReport. I can not obtain one report. And it’s not consitent, since the subproject report is created in the parent build directory and the main target subproject is created in its own build folder.

subprojects {
    apply plugin: 'jacoco'
    jacoco {
        append = true
        toolVersion = "0.6.3.201306030806"
    }
}

I already tried this solution http://forums.gradle.org/gradle/topics/gradle_1_6_jacoco_in_multi_module_build , but it didn’t work at all.

Btw: I think I found a bug. Once I add this code snippet, I get an exception:

jacocoTestReport {
    reports {
        xml.enabled false
        csv.enabled false
        html.destination "${buildDir}/jacocoHtml"
    }
}
FAILURE: Build failed with an exception.
  * Where:
Script 'C:\workspaces\DashboardWorkspace\jacoco-in-seprate-file\jacoco.gradle' line: 9
  * What went wrong:
A problem occurred evaluating script.
&rt; Could not find method jacocoTestReport() for arguments [jacoco_1bi51vlrg82j64ilgshjg5tf1u$_run_closure1_closure3@731e90] on root project 'jacoco-in-seprate-file'.

Sample project: https://github.com/mlem/jacoco-in-seperate-file

Jacoco-Gradle Documentation: http://www.gradle.org/docs/current/userguide/jacoco_plugin.html