gradle插件不包括在内

gradle插件不包括在内

本文介绍了JaCoCo gradle插件不包括在内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从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插件不包括在内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 03:09