Skip to content

Commit 40c6411

Browse files
committed
Rely on Develocity injection script to configure server URL
1 parent 48cc7f1 commit 40c6411

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ def GRADLE_ENTERPRISE_PLUGIN_ID = 'com.gradle.enterprise'
1717
def DEVELOCITY_PLUGIN_ID = 'com.gradle.develocity'
1818
def CCUD_PLUGIN_ID = 'com.gradle.common-custom-user-data-gradle-plugin'
1919

20-
def develocityUrl = getInputParam('develocity.build-validation.url')
21-
def develocityAllowUntrustedServer = Boolean.parseBoolean(getInputParam('develocity.build-validation.allow-untrusted-server'))
22-
2320
def expDir = getInputParam('develocity.build-validation.expDir')
2421
def expId = getInputParam('develocity.build-validation.expId')
2522
def runId = getInputParam('develocity.build-validation.runId')
@@ -109,12 +106,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
109106
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
110107
// only execute if Develocity plugin isn't applied
111108
if (pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
112-
113-
if (develocityUrl) {
114-
buildScan.server = develocityUrl
115-
buildScan.allowUntrustedServer = develocityAllowUntrustedServer
116-
}
117-
118109
if (!buildScan.server) {
119110
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy#gradle_5_x_2')
120111
}
@@ -125,11 +116,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
125116
}
126117

127118
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
128-
if (develocityUrl) {
129-
develocity.server = develocityUrl
130-
develocity.allowUntrustedServer = develocityAllowUntrustedServer
131-
}
132-
133119
if (!develocity.server.present) {
134120
develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
135121
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')
@@ -153,12 +139,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
153139
settings.pluginManager.withPlugin(GRADLE_ENTERPRISE_PLUGIN_ID) {
154140
// only execute if Develocity plugin isn't applied
155141
if (settings.pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
156-
157-
if (develocityUrl) {
158-
settings.gradleEnterprise.server = develocityUrl
159-
settings.gradleEnterprise.allowUntrustedServer = develocityAllowUntrustedServer
160-
}
161-
162142
if (!settings.gradleEnterprise.server) {
163143
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy/#gradle_6_x_and_later_2')
164144
}
@@ -169,11 +149,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
169149
}
170150

171151
settings.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
172-
if (develocityUrl) {
173-
settings.develocity.server = develocityUrl
174-
settings.develocity.allowUntrustedServer = develocityAllowUntrustedServer
175-
}
176-
177152
if (!settings.develocity.server.present) {
178153
settings.develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
179154
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')

components/scripts/lib/gradle.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ invoke_gradle() {
2727

2828
if [ -n "${ge_server}" ]; then
2929
envs+=(
30-
DEVELOCITY_BUILD_VALIDATION_URL="${ge_server}"
31-
DEVELOCITY_BUILD_VALIDATION_ALLOW_UNTRUSTED_SERVER=false
30+
DEVELOCITY_URL="${ge_server}"
31+
DEVELOCITY_ENFORCE_URL=true
32+
DEVELOCITY_ALLOW_UNTRUSTED_SERVER=false
3233
)
3334
fi
3435

0 commit comments

Comments
 (0)