Skip to content

Commit 8fe036f

Browse files
committed
Rely on Develocity injection script to configure server URL
1 parent 7341e10 commit 8fe036f

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')
@@ -108,11 +106,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
108106
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
109107
// only execute if Develocity plugin isn't applied
110108
if (pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
111-
112-
if (develocityUrl) {
113-
buildScan.server = develocityUrl
114-
}
115-
116109
if (!buildScan.server) {
117110
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy#gradle_5_x_2')
118111
}
@@ -123,10 +116,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
123116
}
124117

125118
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
126-
if (develocityUrl) {
127-
develocity.server = develocityUrl
128-
}
129-
130119
if (!develocity.server.present) {
131120
develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
132121
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')
@@ -150,11 +139,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
150139
settings.pluginManager.withPlugin(GRADLE_ENTERPRISE_PLUGIN_ID) {
151140
// only execute if Develocity plugin isn't applied
152141
if (settings.pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
153-
154-
if (develocityUrl) {
155-
settings.gradleEnterprise.server = develocityUrl
156-
}
157-
158142
if (!settings.gradleEnterprise.server) {
159143
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy/#gradle_6_x_and_later_2')
160144
}
@@ -165,10 +149,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
165149
}
166150

167151
settings.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
168-
if (develocityUrl) {
169-
settings.develocity.server = develocityUrl
170-
}
171-
172152
if (!settings.develocity.server.present) {
173153
settings.develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
174154
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)