Skip to content

Commit c06554a

Browse files
authored
Avoid invoking com.gradle.enterprise backwards compat code when using develocity (#42)
1 parent c6d86e2 commit c06554a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/kotlin/com/ebay/plugins/metrics/develocity/MetricsForDevelocityPlugin.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ internal class MetricsForDevelocityPlugin @Inject constructor(
5959
// Auto-configure the Gradle Enterprise access if the plugin is applied and has been
6060
// directly configured with a server URL and/or access key.
6161
settings.plugins.withId("com.gradle.enterprise") {
62+
// The Develocity plugin is also registered under this ID so we need to avoid running
63+
// this logic when this is the case.
64+
if (settings.plugins.hasPlugin("com.gradle.develocity")) {
65+
return@withId
66+
}
67+
6268
@Suppress("DEPRECATION") // GradleEnterpriseExtension is deprecated
6369
val gradleExt = settings.extensions.getByType(com.gradle.enterprise.gradleplugin.GradleEnterpriseExtension::class.java)
6470
settings.gradle.afterProject { project ->

0 commit comments

Comments
 (0)