Skip to content

Commit 8be1229

Browse files
committed
Rely on Develocity injection script to configure server URL
1 parent a5b5df7 commit 8be1229

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

Diff for: build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ val develocityMavenComponents by configurations.creating
8787

8888
dependencies {
8989
argbash("argbash:argbash:2.10.0@zip")
90-
develocityInjection("com.gradle:develocity-injection:1.0")
90+
develocityInjection("com.gradle:develocity-injection:1.1")
9191
develocityComponents("com.gradle:build-scan-summary:$buildScanSummaryVersion")
9292
develocityMavenComponents("com.gradle:gradle-enterprise-maven-extension:1.18.4")
9393
mavenComponents(project(path = ":configure-gradle-enterprise-maven-extension", configuration = "shadow"))

Diff for: components/scripts/gradle/gradle-init-scripts/configure-build-validation.gradle

-25
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')
@@ -113,12 +110,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
113110
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
114111
// only execute if Develocity plugin isn't applied
115112
if (pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
116-
117-
if (develocityUrl) {
118-
buildScan.server = develocityUrl
119-
buildScan.allowUntrustedServer = develocityAllowUntrustedServer
120-
}
121-
122113
if (!buildScan.server) {
123114
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy#gradle_5_x_2')
124115
}
@@ -129,11 +120,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
129120
}
130121

131122
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
132-
if (develocityUrl) {
133-
develocity.server = develocityUrl
134-
develocity.allowUntrustedServer = develocityAllowUntrustedServer
135-
}
136-
137123
if (!develocity.server.present) {
138124
develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
139125
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')
@@ -157,12 +143,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
157143
settings.pluginManager.withPlugin(GRADLE_ENTERPRISE_PLUGIN_ID) {
158144
// only execute if Develocity plugin isn't applied
159145
if (settings.pluginManager.hasPlugin(DEVELOCITY_PLUGIN_ID)) return
160-
161-
if (develocityUrl) {
162-
settings.gradleEnterprise.server = develocityUrl
163-
settings.gradleEnterprise.allowUntrustedServer = develocityAllowUntrustedServer
164-
}
165-
166146
if (!settings.gradleEnterprise.server) {
167147
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/legacy/#gradle_6_x_and_later_2')
168148
}
@@ -173,11 +153,6 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
173153
}
174154

175155
settings.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
176-
if (develocityUrl) {
177-
settings.develocity.server = develocityUrl
178-
settings.develocity.allowUntrustedServer = develocityAllowUntrustedServer
179-
}
180-
181156
if (!settings.develocity.server.present) {
182157
settings.develocity.buildScan.publishing.onlyIf { false } // prevent publishing to scans.gradle.com
183158
failMissingDevelocityServerURL('https://docs.gradle.com/develocity/gradle-plugin/current/#connecting_to_develocity')

Diff for: components/scripts/lib/gradle.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ invoke_gradle() {
2929

3030
if [ -n "${ge_server}" ]; then
3131
args+=(
32-
-Ddevelocity.build-validation.url="${ge_server}"
33-
-Ddevelocity.build-validation.allow-untrusted-server=false
32+
-Ddevelocity.url="${ge_server}"
33+
-Ddevelocity.enforce-url=true
34+
-Ddevelocity.allow-untrusted-server=false
3435
)
3536
fi
3637

0 commit comments

Comments
 (0)