Loading src/cache-base.ts +4 −1 Changes for src/cache-base.ts: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -146,7 +146,8 @@ export abstract class AbstractCache { const cacheResult = await this.restoreCache(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys) if (!cacheResult) { core.info(`${this.cacheDescription} cache not found. Will start with empty.`) core.info(`${this.cacheDescription} cache not found. Will initialize empty.`) await this.initializeState() return } Loading Loading @@ -181,6 +182,8 @@ export abstract class AbstractCache { } } protected async initializeState(): Promise<void> {} protected async afterRestore(_listener: CacheListener): Promise<void> {} async save(listener: CacheListener): Promise<void> { Loading src/cache-gradle-user-home.ts +12 Changes for src/cache-gradle-user-home.ts: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,6 +22,18 @@ export class GradleUserHomeCache extends AbstractCache { this.gradleUserHome = this.determineGradleUserHome(rootDir) } async initializeState(): Promise<void> { this.initializeGradleUserHome(this.gradleUserHome) } private initializeGradleUserHome(gradleUserHome: string): void { fs.mkdirSync(gradleUserHome, {recursive: true}) const propertiesFile = path.resolve(gradleUserHome, 'gradle.properties') this.debug(`Initializing gradle.properties to disable daemon: ${propertiesFile}`) fs.writeFileSync(propertiesFile, 'org.gradle.daemon=false') } async afterRestore(listener: CacheListener): Promise<void> { await this.reportGradleUserHomeSize('as restored from cache') await this.restoreArtifactBundles(listener) Loading src/execution.ts −3 Changes for src/execution.ts: 0 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,9 +6,6 @@ import {writeInitScript} from './build-scan-capture' export async function execute(executable: string, root: string, args: string[]): Promise<BuildResult> { let buildScanUrl: string | undefined // TODO: instead of running with no-daemon, run `--stop` in post action. args.push('--no-daemon') const initScript = writeInitScript() args.push('--init-script') args.push(initScript) Loading Loading
src/cache-base.ts +4 −1 Changes for src/cache-base.ts: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -146,7 +146,8 @@ export abstract class AbstractCache { const cacheResult = await this.restoreCache(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys) if (!cacheResult) { core.info(`${this.cacheDescription} cache not found. Will start with empty.`) core.info(`${this.cacheDescription} cache not found. Will initialize empty.`) await this.initializeState() return } Loading Loading @@ -181,6 +182,8 @@ export abstract class AbstractCache { } } protected async initializeState(): Promise<void> {} protected async afterRestore(_listener: CacheListener): Promise<void> {} async save(listener: CacheListener): Promise<void> { Loading
src/cache-gradle-user-home.ts +12 Changes for src/cache-gradle-user-home.ts: 12 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -22,6 +22,18 @@ export class GradleUserHomeCache extends AbstractCache { this.gradleUserHome = this.determineGradleUserHome(rootDir) } async initializeState(): Promise<void> { this.initializeGradleUserHome(this.gradleUserHome) } private initializeGradleUserHome(gradleUserHome: string): void { fs.mkdirSync(gradleUserHome, {recursive: true}) const propertiesFile = path.resolve(gradleUserHome, 'gradle.properties') this.debug(`Initializing gradle.properties to disable daemon: ${propertiesFile}`) fs.writeFileSync(propertiesFile, 'org.gradle.daemon=false') } async afterRestore(listener: CacheListener): Promise<void> { await this.reportGradleUserHomeSize('as restored from cache') await this.restoreArtifactBundles(listener) Loading
src/execution.ts −3 Changes for src/execution.ts: 0 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -6,9 +6,6 @@ import {writeInitScript} from './build-scan-capture' export async function execute(executable: string, root: string, args: string[]): Promise<BuildResult> { let buildScanUrl: string | undefined // TODO: instead of running with no-daemon, run `--stop` in post action. args.push('--no-daemon') const initScript = writeInitScript() args.push('--init-script') args.push(initScript) Loading