From 6cc033f2b3653074576858c87f604c02493e5182 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Fri, 3 Jun 2022 07:12:23 -0600 Subject: [PATCH] Make build-result-capture script compatible with config-cache --- src/resources/build-result-capture.init.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/resources/build-result-capture.init.gradle b/src/resources/build-result-capture.init.gradle index fdb8997..b9936de 100644 --- a/src/resources/build-result-capture.init.gradle +++ b/src/resources/build-result-capture.init.gradle @@ -27,7 +27,10 @@ if (isTopLevelBuild) { def registerCallbacks(buildScanExtension, rootProjectName) { buildScanExtension.with { + def requestedTasks = gradle.startParameter.taskNames.join(" ") + def gradleVersion = GradleVersion.current().version def buildFailed = false + buildFinished { result -> buildFailed = (result.failure != null) } @@ -38,8 +41,6 @@ def registerCallbacks(buildScanExtension, rootProjectName) { def buildResultsFile = new File(buildResultsDir, System.getenv("GITHUB_ACTION") + System.currentTimeMillis() + ".json") - def requestedTasks = gradle.startParameter.taskNames.join(" ") - def gradleVersion = GradleVersion.current().version def buildScanUri = buildScan.buildScanUri.toASCIIString() def buildResults = [ rootProject: rootProjectName,