Skip to content

Commit

Permalink
Apply crashlytics on frdoid build
Browse files Browse the repository at this point in the history
FDroid build will be used for beta apk generation. Please note that this
will never be the case on a regualr production build. Do not apply this
commit on master
  • Loading branch information
Nain57 committed May 19, 2024
1 parent 9a3372f commit 619a3fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package com.buzbuz.gradle.convention

import com.buzbuz.gradle.convention.utils.android
import com.buzbuz.gradle.convention.utils.getLibs
import com.buzbuz.gradle.convention.utils.playStoreImplementation
import com.buzbuz.gradle.convention.utils.plugins
import com.buzbuz.gradle.convention.utils.releaseImplementation

import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension

Expand All @@ -43,23 +43,23 @@ class CrashlyticsConventionPlugin : Plugin<Project> {
getByName("release") {
configure<CrashlyticsExtension> {
nativeSymbolUploadEnabled = true
unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/playStoreRelease/mergePlayStoreReleaseNativeLibs/out/lib"
unstrippedNativeLibsDir = "build/intermediates/merged_native_libs/fDroidRelease/mergeFDroidReleaseNativeLibs/out/lib"
}
}
}
}

dependencies {
playStoreImplementation(platform(libs.getLibrary("google.firebase.bom")))
playStoreImplementation(libs.getLibrary("google.firebase.crashlytics.ktx"))
playStoreImplementation(libs.getLibrary("google.firebase.crashlytics.ndk"))
releaseImplementation(platform(libs.getLibrary("google.firebase.bom")))
releaseImplementation(libs.getLibrary("google.firebase.crashlytics.ktx"))
releaseImplementation(libs.getLibrary("google.firebase.crashlytics.ndk"))
}

afterEvaluate {
tasks.filter { task ->
task.name.startsWith("uploadCrashlyticsSymbolFilePlayStoreRelease")
task.name.startsWith("uploadCrashlyticsSymbolFileFDroidRelease")
}.forEach { task ->
task.shouldRunAfter("assemblePlayStoreRelease")
task.shouldRunAfter("assembleFDroidRelease")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope
internal fun DependencyHandlerScope.implementation(dependency: Provider<MinimalExternalModuleDependency>) =
add("implementation", dependency)

internal fun DependencyHandlerScope.releaseImplementation(dependency: Provider<MinimalExternalModuleDependency>) =
add("releaseImplementation", dependency)

internal fun DependencyHandlerScope.playStoreImplementation(dependency: Provider<MinimalExternalModuleDependency>) =
add("playStoreImplementation", dependency)

Expand Down
5 changes: 1 addition & 4 deletions smartautoclicker/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ android {
// Apply signature convention after declaring the signingConfigs
apply { plugin(libs.plugins.buzbuz.androidSigning.get().pluginId) }

// Only apply gms/firebase plugins if we are building for the play store
if (buildParameters.isBuildForVariant("playStoreRelease")) {
apply { plugin(libs.plugins.buzbuz.crashlytics.get().pluginId) }
}
apply { plugin(libs.plugins.buzbuz.crashlytics.get().pluginId) }

dependencies {
implementation(libs.kotlinx.coroutines.core)
Expand Down
File renamed without changes.

0 comments on commit 619a3fb

Please sign in to comment.