Skip to content

Add Gradle configuration cache support - #217

Open
ppantisawat wants to merge 7 commits into
scoverage:masterfrom
ppantisawat:feat/configuration-cache
Open

Add Gradle configuration cache support#217
ppantisawat wants to merge 7 commits into
scoverage:masterfrom
ppantisawat:feat/configuration-cache

Conversation

@ppantisawat

@ppantisawat ppantisawat commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Gradle 9 configuration cache support via typed tasks, scoverageTest companion tasks, and configuration-time aggregate wiring. Replaces doLast check/prune logic with CheckScoverageTask and PruneIdenticalScoverageClassesTask. CI runs with --configuration-cache.

Behavioral change

Coverage no longer mutates the test classpath. Use scoverageTest (or scoverageIntTest, etc.) for instrumented runs, e.g. scoverageTest --tests ....

Review guide

  1. test: add configuration cache functional test harness
  2. refactor: use abstract properties on scoverage tasks
  3. refactor: extract check and prune tasks for configuration cache
  4. refactor: run coverage via scoverageTest companion tasks
  5. refactor: wire aggregateScoverage at configuration time
  6. refactor: extract scoverage dependency configuration
  7. feat: enable configuration cache and CI

Known limitations

  • afterEvaluate still used for dependency and task wiring
  • Scala compile doFirst still captures Configuration

Pakanon Pantisawat added 7 commits July 1, 2026 10:50
Add helpers to run Gradle TestKit with --configuration-cache and assert
store/reuse. The acceptance test stays @ignore until the plugin is CC-safe.
Convert ScoverageReport and ScoverageAggregate to abstract task types with
Property getters so task state is wired explicitly from the plugin.
Move coverage verification into CheckScoverageTask and identical-class
cleanup into PruneIdenticalScoverageClassesTask. Resolve scalac plugin
jars in compileScoverageScala doFirst without referencing Project.
Register instrumented test tasks instead of mutating test classpath in
taskGraph.whenReady. Report tasks depend on scoverageTest; functional tests
that filter coverage measurement target scoverageTest explicitly.
Register root aggregateScoverage when the plugin is applied to a parent
project and connect subprojects via plugins.withId instead of
projectsEvaluated.
Move scoverage artifact wiring into configureScoverageDependencies so
dependency resolution stays isolated from task graph configuration.
Enable CC functional tests with stable store/reuse assertions, document
scoverageTest companions and CC support, harden plugin closures for CC
serialization, and run CI with --configuration-cache.
@maiflai

maiflai commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

thanks - this looks interesting but I worry that the change in behaviour is essentially reverting #57.

I suppose that mutating the classpath breaks configuration caching?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants