Update develocity-injection init script to v2.0 (#593)

Updates the develocity-injection init script to the latest reference
script content
from https://github.com/gradle/develocity-ci-injection.

---------

Co-authored-by: daz <daz@gradle.com>
This commit is contained in:
Bot Githubaction 2025-04-04 21:39:30 +02:00 committed by GitHub
parent df11ab8fb2
commit 572d36861a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 99 additions and 87 deletions

View File

@ -27,9 +27,9 @@ jobs:
inject-develocity: inject-develocity:
env: env:
DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_INJECTION_ENABLED: true
DEVELOCITY_URL: https://ge.solutions-team.gradle.com DEVELOCITY_INJECTION_URL: https://ge.solutions-team.gradle.com
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1' DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION: '2.1'
${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }} ${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
strategy: strategy:
fail-fast: false fail-fast: false
@ -74,9 +74,9 @@ jobs:
inject-develocity-with-access-key: inject-develocity-with-access-key:
env: env:
DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_INJECTION_ENABLED: true
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com' DEVELOCITY_INJECTION_URL: 'https://ge.solutions-team.gradle.com'
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1' DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION: '2.1'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -115,9 +115,9 @@ jobs:
inject-develocity-short-lived-token-failed: inject-develocity-short-lived-token-failed:
env: env:
DEVELOCITY_INJECTION_ENABLED: true DEVELOCITY_INJECTION_ENABLED: true
DEVELOCITY_URL: 'https://localhost:3333/' DEVELOCITY_INJECTION_URL: 'https://localhost:3333/'
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }} DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1' DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION: '2.1'
# Access key also set as an env var, we want to check it does not leak # Access key also set as an env var, we want to check it does not leak
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

View File

@ -870,7 +870,7 @@ This access key will be used during the action execution to get a short-lived to
The `init-script` supports several additional configuration parameters that you may find useful. All configuration options (required and optional) are detailed below: The `init-script` supports several additional configuration parameters that you may find useful. All configuration options (required and optional) are detailed below:
| Variable | Required | Description | | Variable | Required | Description |
|--------------------------------------| --- |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |--------------------------------------| :---: |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| develocity-injection-enabled | :white_check_mark: | enables Develocity injection | | develocity-injection-enabled | :white_check_mark: | enables Develocity injection |
| develocity-url | :white_check_mark: | the URL of the Develocity server | | develocity-url | :white_check_mark: | the URL of the Develocity server |
| develocity-allow-untrusted-server | | allow communication with an untrusted server; set to _true_ if your Develocity instance is using a self-signed certificate | | develocity-allow-untrusted-server | | allow communication with an untrusted server; set to _true_ if your Develocity instance is using a self-signed certificate |
@ -884,18 +884,18 @@ The `init-script` supports several additional configuration parameters that you
The input parameters can be expressed as environment variables following the relationships outlined in the table below: The input parameters can be expressed as environment variables following the relationships outlined in the table below:
| Input | Environment Variable | | Input | Environment Variable |
|--------------------------------------|--------------------------------------| |--------------------------------------|------------------------------------------------|
| develocity-injection-enabled | DEVELOCITY_INJECTION_ENABLED | | develocity-injection-enabled | DEVELOCITY_INJECTION_ENABLED |
| develocity-url | DEVELOCITY_URL | | develocity-url | DEVELOCITY_INJECTION_URL |
| develocity-allow-untrusted-server | DEVELOCITY_ALLOW_UNTRUSTED_SERVER | | develocity-enforce-url | DEVELOCITY_INJECTION_ENFORCE_URL |
| develocity-capture-file-fingerprints | DEVELOCITY_CAPTURE_FILE_FINGERPRINTS | | develocity-allow-untrusted-server | DEVELOCITY_INJECTION_ALLOW_UNTRUSTED_SERVER |
| develocity-enforce-url | DEVELOCITY_ENFORCE_URL | | develocity-capture-file-fingerprints | DEVELOCITY_INJECTION_CAPTURE_FILE_FINGERPRINTS |
| develocity-plugin-version | DEVELOCITY_PLUGIN_VERSION | | develocity-plugin-version | DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION |
| develocity-ccud-plugin-version | DEVELOCITY_CCUD_PLUGIN_VERSION | | develocity-ccud-plugin-version | DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION |
| gradle-plugin-repository-url | GRADLE_PLUGIN_REPOSITORY_URL | | gradle-plugin-repository-url | DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_URL |
| gradle-plugin-repository-username | GRADLE_PLUGIN_REPOSITORY_USERNAME | | gradle-plugin-repository-username | DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_USERNAME|
| gradle-plugin-repository-password | GRADLE_PLUGIN_REPOSITORY_PASSWORD | | gradle-plugin-repository-password | DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_PASSWORD|
Here's an example using the env vars: Here's an example using the env vars:

View File

@ -4,28 +4,40 @@ import {setupToken} from './short-lived-token'
export async function setup(config: BuildScanConfig): Promise<void> { export async function setup(config: BuildScanConfig): Promise<void> {
maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle') maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle')
maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions') maybeExportVariable('DEVELOCITY_INJECTION_CUSTOM_VALUE', 'gradle-actions')
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENABLED', config.getDevelocityInjectionEnabled()) maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENABLED', config.getDevelocityInjectionEnabled())
maybeExportVariableNotEmpty('DEVELOCITY_URL', config.getDevelocityUrl()) maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_URL', config.getDevelocityUrl())
maybeExportVariableNotEmpty('DEVELOCITY_ALLOW_UNTRUSTED_SERVER', config.getDevelocityAllowUntrustedServer()) maybeExportVariableNotEmpty(
maybeExportVariableNotEmpty('DEVELOCITY_CAPTURE_FILE_FINGERPRINTS', config.getDevelocityCaptureFileFingerprints()) 'DEVELOCITY_INJECTION_ALLOW_UNTRUSTED_SERVER',
maybeExportVariableNotEmpty('DEVELOCITY_ENFORCE_URL', config.getDevelocityEnforceUrl()) config.getDevelocityAllowUntrustedServer()
maybeExportVariableNotEmpty('DEVELOCITY_PLUGIN_VERSION', config.getDevelocityPluginVersion()) )
maybeExportVariableNotEmpty('DEVELOCITY_CCUD_PLUGIN_VERSION', config.getDevelocityCcudPluginVersion()) maybeExportVariableNotEmpty(
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl()) 'DEVELOCITY_INJECTION_CAPTURE_FILE_FINGERPRINTS',
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername()) config.getDevelocityCaptureFileFingerprints()
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword()) )
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENFORCE_URL', config.getDevelocityEnforceUrl())
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', config.getDevelocityPluginVersion())
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION', config.getDevelocityCcudPluginVersion())
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION__PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl())
maybeExportVariableNotEmpty(
'DEVELOCITY_INJECTION__PLUGIN_REPOSITORY_USERNAME',
config.getGradlePluginRepositoryUsername()
)
maybeExportVariableNotEmpty(
'DEVELOCITY_INJECTION__PLUGIN_REPOSITORY_PASSWORD',
config.getGradlePluginRepositoryPassword()
)
// If build-scan-publish is enabled, ensure the environment variables are set // If build-scan-publish is enabled, ensure the environment variables are set
// The DEVELOCITY_PLUGIN_VERSION and DEVELOCITY_CCUD_PLUGIN_VERSION are set to the latest versions // The DEVELOCITY_PLUGIN_VERSION and DEVELOCITY_CCUD_PLUGIN_VERSION are set to the latest versions
// except if they are defined in the configuration // except if they are defined in the configuration
if (config.getBuildScanPublishEnabled()) { if (config.getBuildScanPublishEnabled()) {
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true') maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.19.2') maybeExportVariable('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', '3.19.2')
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.1') maybeExportVariable('DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION', '2.1')
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl()) maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree()) maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
} }
return setupToken( return setupToken(

View File

@ -1,6 +1,6 @@
/* /*
* Initscript for injection of Develocity into Gradle builds. * Initscript for injection of Develocity into Gradle builds.
* Version: 1.3 * Version: 2.0
*/ */
import org.gradle.util.GradleVersion import org.gradle.util.GradleVersion
@ -18,24 +18,24 @@ initscript {
return gradle.startParameter.systemPropertiesArgs[name] ?: System.getProperty(name) ?: System.getenv(envVarName) return gradle.startParameter.systemPropertiesArgs[name] ?: System.getProperty(name) ?: System.getenv(envVarName)
} }
def requestedInitScriptName = getInputParam(gradle, 'develocity.injection.init-script-name') def requestedInitScriptName = getInputParam(gradle, 'develocity-injection.init-script-name')
def initScriptName = buildscript.sourceFile.name def initScriptName = buildscript.sourceFile.name
if (requestedInitScriptName != initScriptName) { if (requestedInitScriptName != initScriptName) {
return return
} }
// Plugin loading is only required for Develocity injection. Abort early if not enabled. // Plugin loading is only required for Develocity injection. Abort early if not enabled.
def develocityInjectionEnabled = Boolean.parseBoolean(getInputParam(gradle, "develocity.injection-enabled")) def develocityInjectionEnabled = Boolean.parseBoolean(getInputParam(gradle, "develocity-injection.enabled"))
if (!develocityInjectionEnabled) { if (!develocityInjectionEnabled) {
return return
} }
def pluginRepositoryUrl = getInputParam(gradle, 'gradle.plugin-repository.url') def pluginRepositoryUrl = getInputParam(gradle, 'develocity-injection.plugin-repository.url')
def pluginRepositoryUsername = getInputParam(gradle, 'gradle.plugin-repository.username') def pluginRepositoryUsername = getInputParam(gradle, 'develocity-injection.plugin-repository.username')
def pluginRepositoryPassword = getInputParam(gradle, 'gradle.plugin-repository.password') def pluginRepositoryPassword = getInputParam(gradle, 'develocity-injection.plugin-repository.password')
def develocityPluginVersion = getInputParam(gradle, 'develocity.plugin.version') def develocityPluginVersion = getInputParam(gradle, 'develocity-injection.develocity-plugin.version')
def ccudPluginVersion = getInputParam(gradle, 'develocity.ccud-plugin.version') def ccudPluginVersion = getInputParam(gradle, 'develocity-injection.ccud-plugin.version')
def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity.injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO
def atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0') def atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0')
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0') def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
@ -91,10 +91,10 @@ if (!isTopLevelBuild) {
return return
} }
def requestedInitScriptName = getInputParam(gradle, 'develocity.injection.init-script-name') def requestedInitScriptName = getInputParam(gradle, 'develocity-injection.init-script-name')
def initScriptName = buildscript.sourceFile.name def initScriptName = buildscript.sourceFile.name
def develocityInjectionEnabled = Boolean.parseBoolean(getInputParam(gradle, "develocity.injection-enabled")) def develocityInjectionEnabled = Boolean.parseBoolean(getInputParam(gradle, "develocity-injection.enabled"))
if (develocityInjectionEnabled) { if (develocityInjectionEnabled) {
if (requestedInitScriptName != initScriptName) { if (requestedInitScriptName != initScriptName) {
logger.log(LogLevel.WARN, "Develocity injection not enabled because requested init script name was '${requestedInitScriptName}', but '${initScriptName}' was expected") logger.log(LogLevel.WARN, "Develocity injection not enabled because requested init script name was '${requestedInitScriptName}', but '${initScriptName}' was expected")
@ -127,17 +127,17 @@ void enableDevelocityInjection() {
def CCUD_PLUGIN_ID = 'com.gradle.common-custom-user-data-gradle-plugin' def CCUD_PLUGIN_ID = 'com.gradle.common-custom-user-data-gradle-plugin'
def CCUD_PLUGIN_CLASS = 'com.gradle.CommonCustomUserDataGradlePlugin' def CCUD_PLUGIN_CLASS = 'com.gradle.CommonCustomUserDataGradlePlugin'
def develocityUrl = getInputParam(gradle, 'develocity.url') def develocityUrl = getInputParam(gradle, 'develocity-injection.url')
def develocityAllowUntrustedServer = Boolean.parseBoolean(getInputParam(gradle, 'develocity.allow-untrusted-server')) def develocityAllowUntrustedServer = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.allow-untrusted-server'))
def develocityEnforceUrl = Boolean.parseBoolean(getInputParam(gradle, 'develocity.enforce-url')) def develocityEnforceUrl = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.enforce-url'))
def buildScanUploadInBackground = Boolean.parseBoolean(getInputParam(gradle, 'develocity.build-scan.upload-in-background')) def buildScanUploadInBackground = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.upload-in-background'))
def develocityCaptureFileFingerprints = getInputParam(gradle, 'develocity.capture-file-fingerprints') ? Boolean.parseBoolean(getInputParam(gradle, 'develocity.capture-file-fingerprints')) : true def develocityCaptureFileFingerprints = getInputParam(gradle, 'develocity-injection.capture-file-fingerprints') ? Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.capture-file-fingerprints')) : true
def develocityPluginVersion = getInputParam(gradle, 'develocity.plugin.version') def develocityPluginVersion = getInputParam(gradle, 'develocity-injection.develocity-plugin.version')
def ccudPluginVersion = getInputParam(gradle, 'develocity.ccud-plugin.version') def ccudPluginVersion = getInputParam(gradle, 'develocity-injection.ccud-plugin.version')
def buildScanTermsOfUseUrl = getInputParam(gradle, 'develocity.terms-of-use.url') def buildScanTermsOfUseUrl = getInputParam(gradle, 'develocity-injection.terms-of-use.url')
def buildScanTermsOfUseAgree = getInputParam(gradle, 'develocity.terms-of-use.agree') def buildScanTermsOfUseAgree = getInputParam(gradle, 'develocity-injection.terms-of-use.agree')
def ciAutoInjectionCustomValueValue = getInputParam(gradle, 'develocity.auto-injection.custom-value') def ciAutoInjectionCustomValueValue = getInputParam(gradle, 'develocity-injection.custom-value')
def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity.injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO
def atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0') def atLeastGradle5 = GradleVersion.current() >= GradleVersion.version('5.0')
def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0') def atLeastGradle4 = GradleVersion.current() >= GradleVersion.version('4.0')
@ -372,7 +372,7 @@ void enableDevelocityInjection() {
} }
void applyPluginExternally(def pluginManager, String pluginClassName, String pluginVersion) { void applyPluginExternally(def pluginManager, String pluginClassName, String pluginVersion) {
def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity.injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO def logLevel = Boolean.parseBoolean(getInputParam(gradle, 'develocity-injection.debug')) ? LogLevel.LIFECYCLE : LogLevel.INFO
logger.log(logLevel, "Applying $pluginClassName with version $pluginVersion via init script") logger.log(logLevel, "Applying $pluginClassName with version $pluginVersion via init script")
def externallyApplied = 'develocity.externally-applied' def externallyApplied = 'develocity.externally-applied'

View File

@ -490,43 +490,43 @@ class TestDevelocityInjection extends BaseInitScriptTest {
def getEnvVars() { def getEnvVars() {
Map<String, String> envVars = [ Map<String, String> envVars = [
DEVELOCITY_INJECTION_INIT_SCRIPT_NAME : "gradle-actions.inject-develocity.init.gradle", DEVELOCITY_INJECTION_INIT_SCRIPT_NAME : "gradle-actions.inject-develocity.init.gradle",
DEVELOCITY_INJECTION_ENABLED : "true", DEVELOCITY_INJECTION_ENABLED : "true",
DEVELOCITY_URL : serverUrl, DEVELOCITY_INJECTION_URL : serverUrl,
DEVELOCITY_ALLOW_UNTRUSTED_SERVER : "true", DEVELOCITY_INJECTION_ALLOW_UNTRUSTED_SERVER : "true",
DEVELOCITY_PLUGIN_VERSION : develocityPluginVersion, DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION: develocityPluginVersion,
DEVELOCITY_BUILD_SCAN_UPLOAD_IN_BACKGROUND: "true", // Need to upload in background since our Mock server doesn't cope with foreground upload DEVELOCITY_INJECTION_UPLOAD_IN_BACKGROUND : "true", // Need to upload in background since our Mock server doesn't cope with foreground upload
DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE : 'gradle-actions', DEVELOCITY_INJECTION_CUSTOM_VALUE : 'gradle-actions',
DEVELOCITY_INJECTION_DEBUG : "true" DEVELOCITY_INJECTION_DEBUG : "true"
] ]
if (enforceUrl) envVars.put("DEVELOCITY_ENFORCE_URL", "true") if (enforceUrl) envVars.put("DEVELOCITY_INJECTION_ENFORCE_URL", "true")
if (ccudPluginVersion != null) envVars.put("DEVELOCITY_CCUD_PLUGIN_VERSION", ccudPluginVersion) if (ccudPluginVersion != null) envVars.put("DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION", ccudPluginVersion)
if (pluginRepositoryUrl != null) envVars.put("GRADLE_PLUGIN_REPOSITORY_URL", pluginRepositoryUrl) if (captureFileFingerprints) envVars.put("DEVELOCITY_INJECTION_CAPTURE_FILE_FINGERPRINTS", "true")
if (pluginRepositoryUsername != null) envVars.put("GRADLE_PLUGIN_REPOSITORY_USERNAME", pluginRepositoryUsername) if (pluginRepositoryUrl != null) envVars.put("DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_URL", pluginRepositoryUrl)
if (pluginRepositoryPassword != null) envVars.put("GRADLE_PLUGIN_REPOSITORY_PASSWORD", pluginRepositoryPassword) if (pluginRepositoryUsername != null) envVars.put("DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_USERNAME", pluginRepositoryUsername)
if (captureFileFingerprints) envVars.put("DEVELOCITY_CAPTURE_FILE_FINGERPRINTS", "true") if (pluginRepositoryPassword != null) envVars.put("DEVELOCITY_INJECTION_PLUGIN_REPOSITORY_PASSWORD", pluginRepositoryPassword)
return envVars return envVars
} }
def getJvmArgs() { def getJvmArgs() {
List<String> jvmArgs = [ List<String> jvmArgs = [
"-Ddevelocity.injection.init-script-name=gradle-actions.inject-develocity.init.gradle", "-Ddevelocity-injection.init-script-name=gradle-actions.inject-develocity.init.gradle",
"-Ddevelocity.injection-enabled=true", "-Ddevelocity-injection.enabled=true",
"-Ddevelocity.url=$serverUrl", "-Ddevelocity-injection.url=$serverUrl",
"-Ddevelocity.allow-untrusted-server=true", "-Ddevelocity-injection.allow-untrusted-server=true",
"-Ddevelocity.plugin.version=$develocityPluginVersion", "-Ddevelocity-injection.develocity-plugin.version=$develocityPluginVersion",
"-Ddevelocity.build-scan.upload-in-background=true", "-Ddevelocity-injection.upload-in-background=true",
"-Ddevelocity.auto-injection.custom-value=gradle-actions", "-Ddevelocity-injection.custom-value=gradle-actions",
"-Ddevelocity.injection.debug=true" "-Ddevelocity-injection.debug=true"
] ]
if (enforceUrl) jvmArgs.add("-Ddevelocity.enforce-url=true") if (enforceUrl) jvmArgs.add("-Ddevelocity-injection.enforce-url=true")
if (ccudPluginVersion != null) jvmArgs.add("-Ddevelocity.ccud-plugin.version=$ccudPluginVersion") if (ccudPluginVersion != null) jvmArgs.add("-Ddevelocity-injection.ccud-plugin.version=$ccudPluginVersion")
if (pluginRepositoryUrl != null) jvmArgs.add("-Dgradle.plugin-repository.url=$pluginRepositoryUrl") if (captureFileFingerprints) jvmArgs.add("-Ddevelocity-injection.capture-file-fingerprints=true")
if (pluginRepositoryUsername != null) jvmArgs.add("-Dgradle.plugin-repository.username=$pluginRepositoryUsername") if (pluginRepositoryUrl != null) jvmArgs.add("-Ddevelocity-injection.plugin-repository.url=$pluginRepositoryUrl")
if (pluginRepositoryPassword != null) jvmArgs.add("-Dgradle.plugin-repository.password=$pluginRepositoryPassword") if (pluginRepositoryUsername != null) jvmArgs.add("-Ddevelocity-injection.plugin-repository.username=$pluginRepositoryUsername")
if (captureFileFingerprints) jvmArgs.add("-Ddevelocity.capture-file-fingerprints=true") if (pluginRepositoryPassword != null) jvmArgs.add("-Ddevelocity-injection.plugin-repository.password=$pluginRepositoryPassword")
return jvmArgs.collect { it.toString() } // Convert from GStrings return jvmArgs.collect { it.toString() } // Convert from GStrings
} }