JaCoCo gradle exclude plugin

I want to exclude some classes from JaCoCo, but exclude doest seems to work.

For example, I want to exclude all Java classes that end with Dao (e.g. com.company.EmplyeeDao).

I tried the following code, but it still appears when I click it on sonar / using JacocoTestReport.

test { jacoco { append = true destinationFile = file("$buildDir/jacoco/jacocoTest.exec") classDumpFile = file("$buildDir/jacoco/classpathdumps") excludes = ['*Dao'] } } 

I use this in conjunction with Android. What's happening?

+1
android gradle jacoco
May 20 '14 at 9:32
source share
1 answer

Try something like this:

 excludes: ['**/Dao*.class'] 

But as I understand it, it excludes the class from jacoco, but the report that Jacoco creates will show you "0% coverage": Gradle problem: https://issues.gradle.org/browse/GRADLE-2955

+4
Sep 22 '14 at 18:16
source share



All Articles