11import org.gradle.util.GradleVersion
22import java.nio.charset.StandardCharsets
33
4- def getInputParam = { String name ->
4+ static getInputParam ( String name ) {
55 def ENV_VAR_PREFIX = ' '
66 def envVarName = ENV_VAR_PREFIX + name. toUpperCase(). replace(' .' , ' _' ). replace(' -' , ' _' )
7- return gradle . startParameter . systemPropertiesArgs[ name] ?: System . getenv(envVarName)
7+ return System . getProperty( name) ?: System . getenv(envVarName)
88}
99
1010def isTopLevelBuild = ! gradle. parent
@@ -31,16 +31,12 @@ def registerBuildScanActions = { def buildScan, def rootProjectName ->
3131 // the configuration of the build, and given its value changes between consecutive build invocations
3232 // it would always invalidate the configuration cache model from the first build invocation
3333 // in the second build invocation
34- //
35- // System.getProperty can be used here because system properties can be read at *execution* time
36- // safely for Gradle 7.0.2 and earlier, and we must do so anyway because referencing a Gradle
37- // script object, e.g., 'gradle.startParameter', from a Groovy closure is not compatible with
38- // configuration cache
39- def getRunNumInputParam = { String name ->
40- def envVarName = name. toUpperCase(). replace(' .' , ' _' ). replace(' -' , ' _' )
34+ def getInputParam = { String name ->
35+ def ENV_VAR_PREFIX = ' '
36+ def envVarName = ENV_VAR_PREFIX + name. toUpperCase(). replace(' .' , ' _' ). replace(' -' , ' _' )
4137 return System . getProperty(name) ?: System . getenv(envVarName)
4238 }
43- def runNum = getRunNumInputParam (' develocity.build-validation.runNum' )
39+ def runNum = getInputParam (' develocity.build-validation.runNum' )
4440 def buildScanUri = publishedBuildScan. buildScanUri
4541 def buildScanId = publishedBuildScan. buildScanId
4642 def port = (buildScanUri. port != -1 ) ? ' :' + buildScanUri. port : ' '
0 commit comments