diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a32cb45b9..017017233 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -259,17 +259,6 @@ dependencies { dokkaPlugin(libs.dokka.android.documentation.plugin) } -val googleServiceKeywords = listOf("crashlytics", "google", "datadog") - -tasks.configureEach { - if ( - googleServiceKeywords.any { name.contains(it, ignoreCase = true) } && name.contains("fdroid", ignoreCase = true) - ) { - project.logger.lifecycle("Disabling task for F-Droid: $name") - enabled = false - } -} - dokka { moduleName.set("Meshtastic App") dokkaSourceSets.main { diff --git a/build-logic/convention/src/main/kotlin/AnalyticsConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AnalyticsConventionPlugin.kt index 6546c7f29..a764054c5 100644 --- a/build-logic/convention/src/main/kotlin/AnalyticsConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AnalyticsConventionPlugin.kt @@ -56,6 +56,18 @@ class AnalyticsConventionPlugin : Plugin { } } } + + // Disable Analytics tasks for non-google flavors + val analyticsKeywords = listOf("crashlytics", "google", "datadog") + tasks.configureEach { + val taskName = name.lowercase() + val isAnalyticsTask = analyticsKeywords.any { taskName.contains(it) } + + if (isAnalyticsTask && taskName.contains("fdroid")) { + logger.lifecycle("AnalyticsConventionPlugin: Disabling task $name") + enabled = false + } + } } } } diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index fff87e61e..e590d3aa7 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -43,17 +43,6 @@ dependencies { googleApi(libs.firebase.crashlytics) } -val googleServiceKeywords = listOf("crashlytics", "google", "datadog") - -tasks.configureEach { - if ( - googleServiceKeywords.any { name.contains(it, ignoreCase = true) } && name.contains("fdroid", ignoreCase = true) - ) { - project.logger.lifecycle("Disabling task for F-Droid: $name") - enabled = false - } -} - android { buildFeatures { buildConfig = true } namespace = "org.meshtastic.core.analytics"