Skip to content

Commit 125cfdb

Browse files
committed
Rely on Develocity injection script to configure server URL
1 parent 750b76b commit 125cfdb

File tree

2 files changed

+1
-20
lines changed

2 files changed

+1
-20
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +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.url')
21-
2220
def expDir = getInputParam('develocity.build-validation.expDir')
2321
def expId = getInputParam('develocity.build-validation.expId')
2422
def runId = getInputParam('develocity.build-validation.runId')
@@ -103,11 +101,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
103101
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
104102
// only execute if Develocity plugin isn't applied
105103
if (pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
106-
107-
if (develocityUrl) {
108-
buildScan.server = develocityUrl
109-
}
110-
111104
if (!buildScan.server) {
112105
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy#gradle_5_x_2')
113106
}
@@ -118,10 +111,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
118111
}
119112

120113
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
121-
if (develocityUrl) {
122-
develocity.server = develocityUrl
123-
}
124-
125114
if (!develocity.server.present) {
126115
develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
127116
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')
@@ -145,11 +134,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
145134
settings.pluginManager.withPlugin(GRADLE_ENTERPRISE_PLUGIN_ID) {
146135
// only execute if Develocity plugin isn't applied
147136
if (settings.pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
148-
149-
if (develocityUrl) {
150-
settings.gradleEnterprise.server = develocityUrl
151-
}
152-
153137
if (!settings.gradleEnterprise.server) {
154138
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy/#gradle_6_x_and_later_2')
155139
}
@@ -160,10 +144,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
160144
}
161145

162146
settings.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
163-
if (develocityUrl) {
164-
settings.develocity.server = develocityUrl
165-
}
166-
167147
if (!settings.develocity.server.present) {
168148
settings.develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
169149
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')

components/scripts/lib/gradle.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ invoke_gradle() {
3030
if [ -n "${ge_server}" ]; then
3131
args+=(
3232
-Ddevelocity.url="${ge_server}"
33+
-Ddevelocity.enforce-url=true
3334
-Ddevelocity.allow-untrusted-server=false
3435
)
3536
fi

0 commit comments

Comments
 (0)