To have Jacoco test coverage reports configured in a single place for all modules within the project and enabled only HTML report.
Not working solutions (all types of reports are generated):
Working solution (only HTML report is generated):
- Why does it require two afterEvaluate blocks (within subprojects block of the root project's build.gradle.kts and within precompiled script testCoverage.gradle.kts)?
- Is it correct approach to achieve the goal?
- This project is a minimal scope of the real project, which demonstrated the issue;
- Real project has several modules. One module left for this demo, cause it is enough to demonstrate the issue with csv and xml reports being generated even though they were disabled. Please, keep in mind that the target is to have it working properly in multimodule environment;
- JUnit 5 plugin required to make Jacoco generate default tasks.