samedi 22 octobre 2016

jacoco test report not excluding a package

I'm trying to exclude from jacoco coverage an entire package, but it's not working.
I've followed the instructions reported in this answer Filter JaCoCo coverage reports with Gradle , but it seems that it is not working for me. This is the code:

   jacocoTestReport {
 reports {
    xml.enabled false
    csv.enabled false
    html.destination "${buildDir}/jacocoHtml"
}
afterEvaluate {
    classDirectories = files(classDirectories.files.collect {
        fileTree(dir: it,
                exclude: ['http://ift.tt/2ehJhHb'])
    })
}

}

I've also tried variations like excludes +=, writing

'**/http://ift.tt/2ehJhHb'

and also by adding

test {
  jacoco {
    excludes += ['http://ift.tt/2ehJhHb',     
  }
}

but still not working.
One thing not clear to me it's what "dir: it" stands for: what should I put there? Could it be that the error?

Aucun commentaire:

Enregistrer un commentaire