问题描述
我想从JaCoCo中排除一些clasess,但排除doest似乎有效。例如,我想排除以Dao结尾的所有Java clasess(例如
我试过了下面的代码,但是当我将它推送到声纳/使用JacocoTestReport时,它仍然显示出来。
$ b $
test {
jacoco {
append = true
destinationFile = file($ buildDir / jacoco / jacocoTest.exec )
classDumpFile = file($ buildDir / jacoco / classpathdumps)
excludes = ['* Dao']
}
}
我将这与Android结合使用。这是怎么回事?
试试这样:
不包括:['** / Dao * .class']
但据我了解,这将排除该类从jacoco,但Jacoco创建的报告将显示覆盖率为0%:
I want to exclude some clasess from JaCoCo but the exclude doest seem to work.
For example i want to exclude all Java clasess that end with Dao (for example com.company.EmplyeeDao).
I have tried the following code, but it still shows up when i push this to sonar / use JacocoTestReport.
test {
jacoco {
append = true
destinationFile = file("$buildDir/jacoco/jacocoTest.exec")
classDumpFile = file("$buildDir/jacoco/classpathdumps")
excludes = ['*Dao']
}
}
I'm using this in combination with Android. What is going on?
Try something like this:
excludes: ['**/Dao*.class']
But as I understand, this will exclude the class from jacoco but the Report that Jacoco creates will show you "0% of coverage":Gradle issue: https://issues.gradle.org/browse/GRADLE-2955
这篇关于JaCoCo gradle插件不包括在内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!