From 05acc776e8373868926ac87dc60d881922f01b96 Mon Sep 17 00:00:00 2001 From: daz Date: Sun, 20 Aug 2023 14:52:11 -0600 Subject: [PATCH] Wire new init-script into action - Copy init-script to Gradle User Home - Rename init-scripts for consistency and clarity --- src/cache-base.ts | 9 +++++---- ...ld-action.build-result-capture-service.plugin.groovy} | 0 ...gradle-build-action.build-result-capture.init.gradle} | 2 +- ...n.github-dependency-graph-gradle-plugin-apply.groovy} | 0 ...dle-build-action.github-dependency-graph.init.gradle} | 2 +- ...le-build-action.inject-gradle-enterprise.init.gradle} | 0 .../gradlebuildaction/TestBuildResultRecorder.groovy | 2 +- .../gradle/gradlebuildaction/TestDependencyGraph.groovy | 2 +- .../TestGradleEnterpriseInjection.groovy | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) rename src/resources/init-scripts/{build-result-capture-service.plugin.groovy => gradle-build-action.build-result-capture-service.plugin.groovy} (100%) rename src/resources/init-scripts/{build-result-capture.init.gradle => gradle-build-action.build-result-capture.init.gradle} (98%) rename src/resources/init-scripts/{github-dependency-graph-gradle-plugin-apply.groovy => gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy} (100%) rename src/resources/init-scripts/{github-dependency-graph.init.gradle => gradle-build-action.github-dependency-graph.init.gradle} (96%) rename src/resources/init-scripts/{inject-gradle-enterprise.init.gradle => gradle-build-action.inject-gradle-enterprise.init.gradle} (100%) diff --git a/src/cache-base.ts b/src/cache-base.ts index d4ac46b..83d6e91 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -189,10 +189,11 @@ org.gradle.java.installations.fromEnv=JAVA_HOME_8_X64,JAVA_HOME_11_X64,JAVA_HOME // Copy init scripts from src/resources const initScriptFilenames = [ - 'build-result-capture.init.gradle', - 'build-result-capture-service.plugin.groovy', - 'github-dependency-graph.init.gradle', - 'github-dependency-graph-gradle-plugin-apply.groovy' + 'gradle-build-action.build-result-capture.init.gradle', + 'gradle-build-action.build-result-capture-service.plugin.groovy', + 'gradle-build-action.github-dependency-graph.init.gradle', + 'gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy', + 'gradle-build-action.inject-gradle-enterprise.init.gradle' ] for (const initScriptFilename of initScriptFilenames) { const initScriptContent = this.readInitScriptAsString(initScriptFilename) diff --git a/src/resources/init-scripts/build-result-capture-service.plugin.groovy b/src/resources/init-scripts/gradle-build-action.build-result-capture-service.plugin.groovy similarity index 100% rename from src/resources/init-scripts/build-result-capture-service.plugin.groovy rename to src/resources/init-scripts/gradle-build-action.build-result-capture-service.plugin.groovy diff --git a/src/resources/init-scripts/build-result-capture.init.gradle b/src/resources/init-scripts/gradle-build-action.build-result-capture.init.gradle similarity index 98% rename from src/resources/init-scripts/build-result-capture.init.gradle rename to src/resources/init-scripts/gradle-build-action.build-result-capture.init.gradle index 6b87b57..141a453 100644 --- a/src/resources/init-scripts/build-result-capture.init.gradle +++ b/src/resources/init-scripts/gradle-build-action.build-result-capture.init.gradle @@ -82,7 +82,7 @@ def captureUsingBuildFinished(gradle, invocationId) { def captureUsingBuildService(settings, invocationId) { gradle.ext.invocationId = invocationId - apply from: 'build-result-capture-service.plugin.groovy' + apply from: 'gradle-build-action.build-result-capture-service.plugin.groovy' } class BuildResults { diff --git a/src/resources/init-scripts/github-dependency-graph-gradle-plugin-apply.groovy b/src/resources/init-scripts/gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy similarity index 100% rename from src/resources/init-scripts/github-dependency-graph-gradle-plugin-apply.groovy rename to src/resources/init-scripts/gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy diff --git a/src/resources/init-scripts/github-dependency-graph.init.gradle b/src/resources/init-scripts/gradle-build-action.github-dependency-graph.init.gradle similarity index 96% rename from src/resources/init-scripts/github-dependency-graph.init.gradle rename to src/resources/init-scripts/gradle-build-action.github-dependency-graph.init.gradle index fdc67f9..e992919 100644 --- a/src/resources/init-scripts/github-dependency-graph.init.gradle +++ b/src/resources/init-scripts/gradle-build-action.github-dependency-graph.init.gradle @@ -31,7 +31,7 @@ if (isTopLevelBuild) { println "Generating dependency graph into '${reportFile}'" } -apply from: 'github-dependency-graph-gradle-plugin-apply.groovy' +apply from: 'gradle-build-action.github-dependency-graph-gradle-plugin-apply.groovy' /** * Using the supplied jobCorrelator value: diff --git a/src/resources/init-scripts/inject-gradle-enterprise.init.gradle b/src/resources/init-scripts/gradle-build-action.inject-gradle-enterprise.init.gradle similarity index 100% rename from src/resources/init-scripts/inject-gradle-enterprise.init.gradle rename to src/resources/init-scripts/gradle-build-action.inject-gradle-enterprise.init.gradle diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy index e27468b..287a984 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder.groovy @@ -5,7 +5,7 @@ import groovy.json.JsonSlurper import static org.junit.Assume.assumeTrue class TestBuildResultRecorder extends BaseInitScriptTest { - def initScript = 'build-result-capture.init.gradle' + def initScript = 'gradle-build-action.build-result-capture.init.gradle' def "produces build results file for build with #testGradleVersion"() { assumeTrue testGradleVersion.compatibleWithCurrentJvm diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy index 5cf1d2b..8f98dc2 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestDependencyGraph.groovy @@ -3,7 +3,7 @@ package com.gradle.gradlebuildaction import static org.junit.Assume.assumeTrue class TestDependencyGraph extends BaseInitScriptTest { - def initScript = 'github-dependency-graph.init.gradle' + def initScript = 'gradle-build-action.github-dependency-graph.init.gradle' static final List NO_DEPENDENCY_GRAPH_VERSIONS = [GRADLE_3_X, GRADLE_4_X] static final List DEPENDENCY_GRAPH_VERSIONS = ALL_VERSIONS - NO_DEPENDENCY_GRAPH_VERSIONS diff --git a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestGradleEnterpriseInjection.groovy b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestGradleEnterpriseInjection.groovy index 95fef7a..91cbcf4 100644 --- a/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestGradleEnterpriseInjection.groovy +++ b/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestGradleEnterpriseInjection.groovy @@ -8,7 +8,7 @@ import static org.junit.Assume.assumeTrue class TestGradleEnterpriseInjection extends BaseInitScriptTest { static final List CCUD_COMPATIBLE_VERSIONS = ALL_VERSIONS - [GRADLE_3_X] - def initScript = 'inject-gradle-enterprise.init.gradle' + def initScript = 'gradle-build-action.inject-gradle-enterprise.init.gradle' private static final GradleVersion GRADLE_6 = GradleVersion.version('6.0')