Skip to content

Conversation

@lolgab
Copy link
Contributor

@lolgab lolgab commented Dec 15, 2025

Fixes #492

This makes scoverage work with incremental compilation. Instead of starting from scratch we reuse the data in scoverage.coverage for files that are not being compiled in this compilation unit (because zinc skipped them).

We read the existing scoverage.coverage and merge it with the new one being generated.

We make sure that statement ids by starting from the max id in the existing coverage.

This PR also refactors the test code a little bit to be able to test for incremental compilation.

@lolgab lolgab force-pushed the incremental-coverage branch from ef87155 to 6d596ed Compare December 15, 2025 10:46
This makes scoverage work with incremental compilation.
Instead of starting from scratch we reuse the data in
`scoverage.coverage` for files that are not being compiled in this
compilation unit (because zinc skipped them).

We read the existing `scoverage.coverage` and merge it with the new
one being generated.

We make sure that statement ids by starting from the max id in the
existing coverage.

This PR also refactors the test code a little bit to be able
to test for incremental compilation.
@lolgab lolgab force-pushed the incremental-coverage branch from 6d596ed to cd5926c Compare December 15, 2025 11:25
lolgab added a commit to lolgab/sbt-scoverage that referenced this pull request Dec 15, 2025
@lolgab lolgab marked this pull request as ready for review December 15, 2025 12:28
Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for contributing.

@tgodzik tgodzik merged commit fd2477a into scoverage:main Dec 15, 2025
57 checks passed
@tgodzik
Copy link
Contributor

tgodzik commented Dec 15, 2025

Do you need a release for the sbt plugin or do you want to test some things still?

@lolgab lolgab deleted the incremental-coverage branch December 15, 2025 15:21
@lolgab
Copy link
Contributor Author

lolgab commented Dec 15, 2025

Do you need a release for the sbt plugin or do you want to test some things still?

Let me test one thing first.

@lolgab
Copy link
Contributor Author

lolgab commented Dec 16, 2025

I'm done with my tests

@tgodzik
Copy link
Contributor

tgodzik commented Dec 16, 2025

The release is out!

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.

Any plan to support incremental compilation?

2 participants