Cache Gradle distributions downloaded for a particular version (#58)

- Cache is separate from (but similar to) the wrapper distribution cache
- New 'distributions-cache-enabled' flag controls caching of all downloaded distributions
  (including wrapper distributions)
- Deprecated the 'wrapper-cache-enabled' flag for removal in v2
This commit is contained in:
Daz DeBoer 2021-07-08 12:22:48 -06:00 committed by GitHub
parent e4ec586f46
commit 33e91b639d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 95 additions and 36 deletions

View file

@ -107,7 +107,16 @@ export function extractGradleWrapperSlugFromDistUri(
}
function isWrapperCacheDisabled(): boolean {
return !github.inputBoolean('wrapper-cache-enabled', true)
// Check if either 'distributions' or 'wrapper' cache has been disabled
const wrapperCacheEnabled = github.inputBoolean(
'wrapper-cache-enabled',
true
)
const distributionsCacheEnabled = github.inputBoolean(
'distributions-cache-enabled',
true
)
return !wrapperCacheEnabled || !distributionsCacheEnabled
}
function getCacheKey(wrapperSlug: string): string {