build: wire up JaCoCo code-coverage reporting #192

Closed
opened 2026-07-03 02:02:01 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-03 02:02:01 +00:00 (Migrated from github.com)

Wire up JaCoCo code-coverage reporting so main's unit-test coverage can be measured (the final code review will use the number; goal is 95%).

Scope

  • Add the JaCoCo Gradle plugin + configuration, compatible with AGP 9.x built-in Kotlin (see CLAUDE.md build-config gotchas — do NOT apply the org.jetbrains.kotlin.android plugin).
  • A jacocoTestReport task tied to testDebugUnitTest, producing XML + HTML reports (JVM/unit-test coverage; instrumented/E2E coverage is out of scope — ci.yml notes device-ABI coverage needs arm64/macOS hosts).
  • Exclude generated code from the denominator so the % reflects hand-written code: Hilt/Dagger (*_Hilt*, hilt_aggregated_deps/**, dagger/**, *_Factory*, *_MembersInjector*), Room (*_Impl*), Compose (*ComposableSingletons*, *$$*), BuildConfig, R/R$*, Manifest*.
  • The full CI gate must stay green (the JaCoCo config must not break assembleDebug/testDebugUnitTest/lintDebug/ktlintCheck/detekt).

Acceptance

./gradlew :app:jacocoTestReport under JDK 21 produces app/build/reports/jacoco/**/*.xml + HTML with a sensible coverage %, and the existing gate stays green.

Wire up JaCoCo code-coverage reporting so main's unit-test coverage can be measured (the final code review will use the number; goal is 95%). ## Scope - Add the JaCoCo Gradle plugin + configuration, compatible with **AGP 9.x built-in Kotlin** (see CLAUDE.md build-config gotchas — do NOT apply the `org.jetbrains.kotlin.android` plugin). - A `jacocoTestReport` task tied to `testDebugUnitTest`, producing XML + HTML reports (JVM/unit-test coverage; instrumented/E2E coverage is out of scope — ci.yml notes device-ABI coverage needs arm64/macOS hosts). - Exclude generated code from the denominator so the % reflects hand-written code: Hilt/Dagger (`*_Hilt*`, `hilt_aggregated_deps/**`, `dagger/**`, `*_Factory*`, `*_MembersInjector*`), Room (`*_Impl*`), Compose (`*ComposableSingletons*`, `*$$*`), `BuildConfig`, `R`/`R$*`, `Manifest*`. - The full CI gate must stay green (the JaCoCo config must not break `assembleDebug`/`testDebugUnitTest`/`lintDebug`/`ktlintCheck`/`detekt`). ## Acceptance `./gradlew :app:jacocoTestReport` under JDK 21 produces `app/build/reports/jacoco/**/*.xml` + HTML with a sensible coverage %, and the existing gate stays green.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#192