From ece69c52b25436207b93779d35e8f368bec5370b Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Sat, 4 Jun 2022 20:59:09 -0600 Subject: [PATCH] Save project-root-list in RUNNER_TEMP dir This feels better than saving in Gradle User Home and is consistent with where the build results are written. --- src/cache-extract-entries.ts | 2 +- src/resources/project-root-capture.plugin.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cache-extract-entries.ts b/src/cache-extract-entries.ts index c7bbe67..fbe7072 100644 --- a/src/cache-extract-entries.ts +++ b/src/cache-extract-entries.ts @@ -387,7 +387,7 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor { * set of project roots, to allow saving of configuration-cache entries for each. */ private getProjectRoots(): string[] { - const projectList = path.resolve(this.gradleUserHome, PROJECT_ROOTS_FILE) + const projectList = path.resolve(process.env['RUNNER_TEMP']!, PROJECT_ROOTS_FILE) if (!fs.existsSync(projectList)) { core.info(`Missing project list file ${projectList}`) return [] diff --git a/src/resources/project-root-capture.plugin.groovy b/src/resources/project-root-capture.plugin.groovy index cb887b0..0886c64 100644 --- a/src/resources/project-root-capture.plugin.groovy +++ b/src/resources/project-root-capture.plugin.groovy @@ -10,7 +10,7 @@ import org.gradle.tooling.events.* settingsEvaluated { settings -> def rootDir = settings.rootDir.absolutePath - def rootListLocation = new File(settings.gradle.gradleUserHomeDir, "project-roots.txt").absolutePath + def rootListLocation = new File(System.getenv("RUNNER_TEMP"), "project-roots.txt").absolutePath def projectTracker = gradle.sharedServices.registerIfAbsent("gradle-build-action-projectRootTracker", ProjectTracker, { spec -> spec.getParameters().getRootDir().set(rootDir);