sbt/util-cache/src/test/scala
Dream 544f56695a
[2.x] feat: Add cacheVersion setting for global cache invalidation (#8993)
* [2.x] feat: Add cacheVersion setting for global cache invalidation

**Problem**
There was no escape hatch to invalidate all task caches when needed.

**Solution**
Add `Global / cacheVersion` setting that incorporates into the cache key
hash. Changing it invalidates all caches. Defaults to reading system
property `sbt.cacheversion`, or else 0L. When 0L, the hash is identical
to the previous behavior (backward compatible).

Fixes #8992

* [2.x] refactor: Simplify BuildWideCacheConfiguration and add cacheVersion test

- Replace auxiliary constructors with default parameter values
- Add unit test verifying cacheVersion invalidates the cache

* [2.x] fix: Restore auxiliary constructors for binary compatibility

* [2.x] test: Improve cacheVersion scripted test and add release note

- Scripted test now verifies cache invalidation via a counter
  that increments only when the task body actually executes
- Add release note documenting the cacheVersion setting
2026-04-01 11:23:10 +09:00
..
sbt/util [2.x] feat: Add cacheVersion setting for global cache invalidation (#8993) 2026-04-01 11:23:10 +09:00
CacheSpec.scala test: Migrate CacheSpec to verify.BasicTestSuite (#8474) 2026-01-11 07:19:22 -05:00
FileInfoSpec.scala [2.x] test: Migrate FileInfoSpec.scala to verify.BasicTestSuite (#8544) 2026-01-15 22:19:30 -05:00
SingletonCacheSpec.scala [2.x] test: Migrate SingletonCacheSpec.scala to verify.BasicTestSuite (#8546) 2026-01-15 14:09:25 -05:00