How to config jacoco.excludes to a module

32 views
Skip to first unread message

朱超

unread,
Nov 20, 2024, 11:34:46 PM11/20/24
to JaCoCo and EclEmma Users
Hello,

My project consists of two modules, A and B. Previously, both modules were configured to use JaCoCo in dynamic mode.

In a recent update, module A switched to using JaCoCo in offline mode. Now, when running unit tests in module A, both offline and dynamic modes run simultaneously, causing the following error:

arduino
复制代码
Caused by: java.lang.IllegalStateException: Cannot process instrumented class ****. Please supply original non-instrumented classes.
I attempted to resolve this issue using the following configuration:

groovy
复制代码
tasks.withType(Test) {
    jacoco.excludes = A module classes
}
This seems to fix the error. However, I would like to know how to configure JaCoCo in Gradle to exclude the entire module A's classes, or automatically scan and exclude all classes from module A, without manually specifying a list.
Reply all
Reply to author
Forward
0 new messages