Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Revert "Migrate injection scripts to use gradle.startParameter.system…
…PropertyArgs"

This reverts commit 512bf7a.
  • Loading branch information
erichaagdev committed Dec 11, 2024
commit 8abaeef5f05ff64f64ddf24bc1b2cbce827bc86e
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ val copyGradleScripts by tasks.registering(Sync::class) {
from(develocityInjectionResolvable) {
rename { "develocity-injection.gradle" }
into("lib/scripts/gradle-init-scripts")
filter(TransformDevelocityInjectionScript())
}
from(layout.projectDirectory.dir("components/scripts")) {
include("README.md")
Expand Down
27 changes: 0 additions & 27 deletions buildSrc/src/main/kotlin/TransformDevelocityInjectionScript.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import org.gradle.util.GradleVersion
import java.nio.charset.StandardCharsets

def getInputParam = { String name ->
static getInputParam(String name) {
def ENV_VAR_PREFIX = ''
def envVarName = ENV_VAR_PREFIX + name.toUpperCase().replace('.', '_').replace('-', '_')
return gradle.startParameter.systemPropertiesArgs[name] ?: System.getenv(envVarName)
return System.getProperty(name) ?: System.getenv(envVarName)
}

def isTopLevelBuild = !gradle.parent
Expand All @@ -31,16 +31,12 @@ def registerBuildScanActions = { def buildScan, def rootProjectName ->
// the configuration of the build, and given its value changes between consecutive build invocations
// it would always invalidate the configuration cache model from the first build invocation
// in the second build invocation
//
// System.getProperty can be used here because system properties can be read at *execution* time
// safely for Gradle 7.0.2 and earlier, and we must do so anyway because referencing a Gradle
// script object, e.g., 'gradle.startParameter', from a Groovy closure is not compatible with
// configuration cache
def getRunNumInputParam = { String name ->
def envVarName = name.toUpperCase().replace('.', '_').replace('-', '_')
def getInputParam = { String name ->
def ENV_VAR_PREFIX = ''
def envVarName = ENV_VAR_PREFIX + name.toUpperCase().replace('.', '_').replace('-', '_')
return System.getProperty(name) ?: System.getenv(envVarName)
}
def runNum = getRunNumInputParam('develocity.build-validation.runNum')
def runNum = getInputParam('develocity.build-validation.runNum')
def buildScanUri = publishedBuildScan.buildScanUri
def buildScanId = publishedBuildScan.buildScanId
def port = (buildScanUri.port != -1) ? ':' + buildScanUri.port : ''
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def getInputParam = { String name ->
static getInputParam(String name) {
def ENV_VAR_PREFIX = ''
def envVarName = ENV_VAR_PREFIX + name.toUpperCase().replace('.', '_').replace('-', '_')
return gradle.startParameter.systemPropertiesArgs[name] ?: System.getenv(envVarName)
return System.getProperty(name) ?: System.getenv(envVarName)
}

def expDir = getInputParam('develocity.build-validation.expDir')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def getInputParam = { String name ->
static getInputParam(String name) {
def ENV_VAR_PREFIX = ''
def envVarName = ENV_VAR_PREFIX + name.toUpperCase().replace('.', '_').replace('-', '_')
return gradle.startParameter.systemPropertiesArgs[name] ?: System.getenv(envVarName)
return System.getProperty(name) ?: System.getenv(envVarName)
}

def remoteBuildCacheUrl = getInputParam('develocity.build-validation.remoteBuildCacheUrl')
Expand Down