Deduplicate logging for URL enforcement

This commit is contained in:
Pavlo Shevchenko 2024-03-11 09:31:58 +01:00 committed by daz
parent 5063836188
commit e33d4754ca
No known key found for this signature in database

View File

@ -176,10 +176,13 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
} }
} }
if (develocityUrl && develocityEnforceUrl) {
logger.lifecycle("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer, captureFileFingerprints: $develocityCaptureFileFingerprints")
}
pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) { pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
afterEvaluate { afterEvaluate {
if (develocityUrl && develocityEnforceUrl) { if (develocityUrl && develocityEnforceUrl) {
logger.lifecycle("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer, captureFileFingerprints: $develocityCaptureFileFingerprints")
buildScan.server = develocityUrl buildScan.server = develocityUrl
buildScan.allowUntrustedServer = develocityAllowUntrustedServer buildScan.allowUntrustedServer = develocityAllowUntrustedServer
} }
@ -254,6 +257,10 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
} }
} }
if (develocityUrl && develocityEnforceUrl) {
logger.lifecycle("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer, captureFileFingerprints: $develocityCaptureFileFingerprints")
}
if (develocityUrl && develocityEnforceUrl) { if (develocityUrl && develocityEnforceUrl) {
logger.lifecycle("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer") logger.lifecycle("Enforcing Develocity: $develocityUrl, allowUntrustedServer: $develocityAllowUntrustedServer")
eachDevelocitySettingsExtension(settings, SETTINGS_EXTENSION_CLASSES) { ext -> eachDevelocitySettingsExtension(settings, SETTINGS_EXTENSION_CLASSES) { ext ->
@ -262,20 +269,19 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
} }
} }
if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) { if (buildScanTermsOfUseUrl && buildScanTermsOfUseAgree) {
ext.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl ext.buildScan.termsOfUseUrl = buildScanTermsOfUseUrl
ext.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree ext.buildScan.termsOfUseAgree = buildScanTermsOfUseAgree
}
ext.buildScan.capture.fileFingerprints = develocityCaptureFileFingerprints
} }
ext.buildScan.capture.fileFingerprints = develocityCaptureFileFingerprints
} }
}
if (ccudPluginVersion) { if (ccudPluginVersion) {
if (!settings.pluginManager.hasPlugin(CCUD_PLUGIN_ID)) { if (!settings.pluginManager.hasPlugin(CCUD_PLUGIN_ID)) {
logger.lifecycle("Applying $CCUD_PLUGIN_CLASS via init script") logger.lifecycle("Applying $CCUD_PLUGIN_CLASS via init script")
settings.pluginManager.apply(initscript.classLoader.loadClass(CCUD_PLUGIN_CLASS)) settings.pluginManager.apply(initscript.classLoader.loadClass(CCUD_PLUGIN_CLASS))
}
} }
} }
} }