Colton Idle
11/20/2025, 2:39 PMenableUnitTestCoverage = true in build.gradle and now I have an additional task in gradle called :app:createDebugUnitTestCoverageReport which generates an html report. this is great.
At a baseline... enabling code cov (via jacoco) wasn't hard.
Customizing it though does seem hard
1. Calling plugins { jacoco } is not necessary?
2. How can I remove classes/packages from being included in the coverage report?
3. enableAndroidTestCoverage = true but I dont get any gradle task generated to create those reportsTrevJonez
11/20/2025, 2:51 PMenableAndroidTestCoverage afaik just turns on a bytecode transform to instrument it for measurement, but its all on you to pull the .exec files from the device that ran the test and create the reporting task. (pretty sure the instrumentation is just sampling periodically because the coverage reports don't seem to be deterministic)
My gradle coverage tasks don't merge unit/ui though since they run in different jobs. I maintain a self hosted version of codecov which lets you upload from multiple jobs before it reports back to a PR.Colton Idle
11/20/2025, 2:54 PMpablozki
11/20/2025, 3:31 PMColton Idle
11/20/2025, 3:51 PMXavier Ducrohet
11/20/2025, 3:53 PMColton Idle
11/20/2025, 4:50 PM