Skip to content

Commit

Permalink
Wire new init-script into action
Browse files Browse the repository at this point in the history
- Copy init-script to Gradle User Home
- Rename init-scripts for consistency and clarity
  • Loading branch information
bigdaz committed Aug 20, 2023
1 parent 33c9bfa commit 05acc77
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/cache-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TestGradleVersion> NO_DEPENDENCY_GRAPH_VERSIONS = [GRADLE_3_X, GRADLE_4_X]
static final List<TestGradleVersion> DEPENDENCY_GRAPH_VERSIONS = ALL_VERSIONS - NO_DEPENDENCY_GRAPH_VERSIONS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import static org.junit.Assume.assumeTrue
class TestGradleEnterpriseInjection extends BaseInitScriptTest {
static final List<TestGradleVersion> 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')

Expand Down

0 comments on commit 05acc77

Please sign in to comment.