'How to debug JaCoCo gradle-plugin
I use JaCoCo when develop android apps.
I think the function excludes of JaCoCo might have a bug.
So I want to debug JaCoCo gradle-plugin.
I tried to debug by jacoco.cli as below.
$ git clone https://github.com/jacoco/jacoco.git
$ cd jacoco
$ mvn clean verify -DskipTests
$ java -jar ./org.jacoco.cli/target/org.jacoco.cli-0.8.9-SNAPSHOT-nodeps.jar report ./testDebugUnitTest.exec --classfiles ../../github/att/android-app/app/build/intermediates/javac/debug/classes --html "./jacoco-report" --name testReport --sourcefiles "../../github/att/android-app/app/src"
But jacoco.cli doesn’t have a excludes option…
I asked the JaCoCo project, but I was told to contact gradle project. https://groups.google.com/g/jacoco/c/NEjyUtPX5eA/m/JWa7avf_AAAJ
How can I debug JaCoCo gradle-plugin?
https://docs.gradle.org/current/userguide/jacoco_plugin.html
Please tell me the way to debug JaCoCo gradle-plugin.
Thank you.
Solution 1:[1]
Welcome to Stack Overflow!
You can basically debug any Gradle build and its plugins using the procedure described in the Gradle Docs.
It might not be a bug in the plugin though. Maybe you just didn't quite get the config right yet. In particular, you often need to configure both the test task and the report task. For example,
// Exclude class Hello4 from Jacoco Coverage in this sub-project:
test {
jacoco {
excludes = ['Hello4']
}
}
jacocoTestReport {
classDirectories.setFrom(fileTree(dir: sourceSets.main.output.classesDirs.first()).exclude(['**/Hello4*']))
sourceDirectories.setFrom(fileTree(dir: sourceSets.main.java.srcDirs.first()).exclude(['**/Hello4*']))
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | barfuin |
