Skip to content

Commit

Permalink
chore: Added Crashlytics deobfuscation files on build time by using a…
Browse files Browse the repository at this point in the history
… custom gradle plugin

Signed-off-by: Gabriel Fontán <[email protected]>
  • Loading branch information
BobbyESP committed Apr 6, 2024
1 parent 1c2c421 commit 08b4061
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
if (isFullBuild) {
apply(plugin = libs.plugins.google.gms.get().pluginId)
apply(plugin = "com.google.firebase.crashlytics")
apply<CrashlyticsBuildConfig>()
}

val commitSignature = providers.exec {
Expand All @@ -22,7 +23,7 @@ val currentVersion: Version = Version.Beta(
versionMajor = 1,
versionMinor = 0,
versionPatch = 0,
versionBuild = 3
versionBuild = 4
)

android {
Expand Down
11 changes: 10 additions & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ plugins {

repositories {
mavenCentral()
}
google()
}

dependencies {
implementation(gradleApi())
implementation("com.google.firebase:firebase-crashlytics-gradle:2.8.1")
}

java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
13 changes: 13 additions & 0 deletions buildSrc/src/main/kotlin/CrashlyticsBuildConfig.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension
import org.gradle.api.Plugin
import org.gradle.api.Project

class CrashlyticsBuildConfig : Plugin<Project> {
override fun apply(target: Project) {
target.extensions.create("crashlytics", CrashlyticsExtension::class.java)
target.extensions.configure<CrashlyticsExtension>("crashlytics") {
mappingFileUploadEnabled = true
nativeSymbolUploadEnabled = false
}
}
}

0 comments on commit 08b4061

Please sign in to comment.