Add experimental support for 'cache-write-only'

There may be cases where it a "fresh" cache entry would be beneficial,
for example if the Gradle User Home cache entry grows over time.

This setting would run the build as if no prior cache entry exists.
This commit is contained in:
Daz DeBoer 2022-01-20 09:36:57 -07:00
parent 0a5ede19a9
commit 08d5b40ca5
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
6 changed files with 69 additions and 19 deletions

View file

@ -28,6 +28,9 @@ export class CacheListener {
}
static rehydrate(stringRep: string): CacheListener {
if (stringRep === '') {
return new CacheListener()
}
const rehydrated: CacheListener = Object.assign(new CacheListener(), JSON.parse(stringRep))
const entries = rehydrated.cacheEntries
for (let index = 0; index < entries.length; index++) {