Skip to content

Commit f747762

Browse files
committed
Defer reading runNum until it's required
1 parent 7d8b1b9 commit f747762

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/scripts/gradle/gradle-init-scripts/configure-gradle-enterprise.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def ccudPluginVersion = getInputParam('com.gradle.enterprise.build-validation.cc
7272
def expDir = getInputParam('com.gradle.enterprise.build-validation.expDir')
7373
def expId = getInputParam('com.gradle.enterprise.build-validation.expId')
7474
def runId = getInputParam('com.gradle.enterprise.build-validation.runId')
75-
def runNum = getInputParam('com.gradle.enterprise.build-validation.runNum')
7675
def scriptsVersion = getInputParam('com.gradle.enterprise.build-validation.scriptsVersion')
7776

7877
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
@@ -87,6 +86,11 @@ if (ccudPluginVersion && isNotAtLeast(ccudPluginVersion, '1.7')) {
8786
def registerBuildScanActions = { def buildScan ->
8887
def scanFile = new File(expDir, 'build-scans.csv')
8988
buildScan.buildScanPublished { publishedBuildScan ->
89+
def getInputParamCompatibleWithCC = { String name ->
90+
def envVarName = name.toUpperCase().replace('.', '_').replace('-', '_')
91+
return System.getProperty(name) ?: System.getenv(envVarName)
92+
}
93+
def runNum = getInputParamCompatibleWithCC('com.gradle.enterprise.build-validation.runNum')
9094
def buildScanUri = publishedBuildScan.buildScanUri
9195
def buildScanId = publishedBuildScan.buildScanId
9296
def port = (buildScanUri.port != -1) ? ':' + buildScanUri.port : ''

0 commit comments

Comments
 (0)