詹金斯缺少Jacoco代码覆盖细节

时间:2015-07-23 15:25:24

标签: android jenkins gradle jacoco

我正在尝试在我的Android库的Jenkins服务器上使用Jacoco的代码覆盖工具。 构建成功,代码覆盖率统计信息显示在报告中:

enter image description here

但是,当我想要了解哪些行的详细信息时,该页面完全为空:

enter image description here

因为这是我最需要的东西,这非常烦人......

以下是我为Jacoco提供的gradle文件的一部分:

apply plugin: 'jacoco'

jacoco {
    // Use this version for upper ones are broken (with Gradle)
    // https://github.com/jacoco/jacoco/issues/288
    toolVersion = "0.7.1.201405082137"
}

// Edit covered scope if needed
def coverageSourceDirs = [
        '../s3papiandroidclient/src'
]

task jacocoTestReport(type: JacocoReport, dependsOn: "test") {
    group = "Reporting"

    description = "Generate Jacoco coverage reports"

    classDirectories = fileTree(
            dir: '../s3papiandroidclient/build/intermediates/classes',
            excludes: ['**/R.class',
                       '**/R$*.class',
                       '**/*$ViewInjector*.*',
                       '**/BuildConfig.*',
                       '**/Manifest*.*']
    )

    additionalSourceDirs = files(coverageSourceDirs)
    sourceDirectories = files(coverageSourceDirs)
    executionData = files('../app/build/jacoco/testUnitTestDebug.exec')

    reports {
        xml.enabled = true
        html.enabled = true
    }

}

jacocoTestReport.doFirst{
    delete fileTree (dir: "../s3papiandroidclient/build/intermediates/classes", include: "**/*Test.class")
}

有人遇到过类似的东西吗?

此致 Gyoo。

0 个答案:

没有答案