Ensure to set terms of service properties on any type of root project plugin

This commit is contained in:
Pavlo Shevchenko 2024-02-08 14:18:39 +01:00
parent 28edd504af
commit 58f48a315c
No known key found for this signature in database
GPG Key ID: A52E2C6DAD8A5DDC

View File

@ -146,28 +146,33 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
buildScanExtension.value CI_AUTO_INJECTION_CUSTOM_VALUE_NAME, CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE buildScanExtension.value CI_AUTO_INJECTION_CUSTOM_VALUE_NAME, CI_AUTO_INJECTION_CUSTOM_VALUE_VALUE
} }
if (develocityUrl && develocityEnforceUrl) { pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
logger.quiet("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer for Build Scan plugin") afterEvaluate {
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) { if (develocityUrl && develocityEnforceUrl) {
afterEvaluate { logger.quiet("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer for Build Scan plugin")
buildScan.server = develocityUrl buildScan.server = develocityUrl
buildScan.allowUntrustedServer = develocityAllowUntrustedServer buildScan.allowUntrustedServer = develocityAllowUntrustedServer
} }
}
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) { if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
afterEvaluate { buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
develocity.server = develocityUrl buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
develocity.allowUntrustedServer = develocityAllowUntrustedServer
} }
} }
} }
pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
afterEvaluate {
if (develocityUrl && develocityEnforceUrl) {
logger.quiet("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer for Build Scan plugin")
develocity.server = develocityUrl
develocity.allowUntrustedServer = develocityAllowUntrustedServer
}
if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) { if (buildScanTermsOfServiceUrl && buildScanTermsOfServiceAgree) {
def buildScanExtension = atLeastGradle5 develocity.buildScan.termsOfServiceUrl = buildScanTermsOfServiceUrl
? dvOrGe(develocity.buildScan, buildScan) develocity.buildScan.termsOfServiceAgree = buildScanTermsOfServiceAgree
: buildScan }
buildScanExtension.termsOfServiceUrl = buildScanTermsOfServiceUrl }
buildScanExtension.termsOfServiceAgree = buildScanTermsOfServiceAgree
} }
} }