From 80b8ae7a98b616031673d6036a93510840026261 Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Sat, 22 Apr 2023 13:53:10 +0100 Subject: [PATCH] Don't rely on `finalizeDsl` API to configure Crashlytics --- ...droidApplicationFirebaseConventionPlugin.kt | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt index 598da727d..7b3a0059f 100644 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -import com.android.build.api.variant.ApplicationAndroidComponentsExtension +import com.android.build.api.dsl.ApplicationExtension import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension import org.gradle.api.Plugin import org.gradle.api.Project @@ -41,15 +41,13 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin { "implementation"(libs.findLibrary("firebase.crashlytics").get()) } - extensions.configure { - finalizeDsl { - it.buildTypes.forEach { buildType -> - // Disable the Crashlytics mapping file upload. This feature should only be - // enabled if a Firebase backend is available and configured in - // google-services.json. - buildType.configure { - mappingFileUploadEnabled = false - } + extensions.configure { + buildTypes.configureEach { + // Disable the Crashlytics mapping file upload. This feature should only be + // enabled if a Firebase backend is available and configured in + // google-services.json. + configure { + mappingFileUploadEnabled = false } } }