Loading src/cache-base.ts +6 Changes for src/cache-base.ts: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -99,6 +99,12 @@ export class GradleStateCache { this.initializeGradleUserHome(this.gradleUserHome, initScriptsDir) } cacheOutputExists(): boolean { // Need to check for 'caches' directory to avoid incorrect detection on MacOS agents const paths = this.getCachePath() return paths.some(x => fs.existsSync(x)) } /** * Restores the cache entry, finding the closest match to the currently running job. */ Loading src/caches.ts +7 Changes for src/caches.ts: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ export async function restore(gradleUserHome: string): Promise<void> { // Initialize the Gradle User Home even when caching is disabled. const gradleStateCache = new GradleStateCache(gradleUserHome) if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') // We still add init-scripts for build-scan capture gradleStateCache.init() return } gradleStateCache.init() if (isCacheDisabled()) { Loading Loading
src/cache-base.ts +6 Changes for src/cache-base.ts: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -99,6 +99,12 @@ export class GradleStateCache { this.initializeGradleUserHome(this.gradleUserHome, initScriptsDir) } cacheOutputExists(): boolean { // Need to check for 'caches' directory to avoid incorrect detection on MacOS agents const paths = this.getCachePath() return paths.some(x => fs.existsSync(x)) } /** * Restores the cache entry, finding the closest match to the currently running job. */ Loading
src/caches.ts +7 Changes for src/caches.ts: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -17,6 +17,13 @@ export async function restore(gradleUserHome: string): Promise<void> { // Initialize the Gradle User Home even when caching is disabled. const gradleStateCache = new GradleStateCache(gradleUserHome) if (gradleStateCache.cacheOutputExists()) { core.info('Gradle User Home already exists: will not restore from cache.') // We still add init-scripts for build-scan capture gradleStateCache.init() return } gradleStateCache.init() if (isCacheDisabled()) { Loading