Skip to content

Commit

Permalink
Enable crashlytics SDK (#1335)
Browse files Browse the repository at this point in the history
* Enable crashlytics SDK

* Specify crashlytics dependency only for android

* Use native crashlytics dependency for android

---------

Co-authored-by: Ashley Davies <[email protected]>
  • Loading branch information
ashdavies and ashdavies authored Nov 19, 2024
1 parent c5e190d commit 1c15afe
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
2 changes: 0 additions & 2 deletions build-plugins/src/main/kotlin/io.ashdavies.kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.DetektPlugin
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension
Expand Down Expand Up @@ -37,7 +36,6 @@ extensions.configure<DetektExtension> {
toolVersion = "${detektPlugin.version}"
}


tasks.withType<KotlinCompile> {

compilerOptions {
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
classpath(cash.sqldelight)
classpath(compose.compiler)
classpath(detekt)
classpath(crashlytics)
classpath(google.services)
classpath(jetbrains.compose)
classpath(kotlin.multiplatform)
Expand Down
8 changes: 6 additions & 2 deletions conferences-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
id("com.android.application")
id("com.google.firebase.crashlytics")
id("com.google.gms.google-services")

id("io.ashdavies.android")
Expand Down Expand Up @@ -133,6 +134,8 @@ kotlin {
implementation(libs.compose.adaptive.layout)
implementation(libs.compose.adaptive.navigation)
implementation(libs.compose.window.size)
implementation(libs.gitlive.firebase.app)
implementation(libs.gitlive.firebase.config)
implementation(libs.kotlinx.collections.immutable)
implementation(libs.kotlinx.datetime)
implementation(libs.kotlinx.serialization.core)
Expand All @@ -156,6 +159,9 @@ kotlin {
androidMain.dependencies {
implementation(libs.androidx.activity.compose)
implementation(libs.google.android.material)

implementation(dependencies.platform(libs.google.firebase.bom))
implementation(libs.google.firebase.crashlytics)
}

val androidDebug by registering {
Expand All @@ -172,8 +178,6 @@ kotlin {
jvmMain.dependencies {
implementation(projects.keyNavigation)
implementation(compose.desktop.currentOs)
implementation(libs.gitlive.firebase.app)
implementation(libs.gitlive.firebase.config)

runtimeOnly(libs.kotlinx.coroutines.swing)
runtimeOnly(libs.slf4j.simple)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.List
import androidx.compose.material.icons.filled.Home
import androidx.compose.material.icons.filled.Warning
import androidx.compose.material3.BottomAppBar
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
Expand Down Expand Up @@ -85,6 +88,12 @@ internal fun HomeScreen(
},
)
}

IconButton(onClick = {
throw RuntimeException("Crashlytics")
}) {
Icon(Icons.Default.Warning, contentDescription = null)
}
},
)
},
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ google-android-location = "com.google.android.gms:play-services-location:21.3.0"
google-android-material = "com.google.android.material:material:1.12.0"

google-auth-http = "com.google.auth:google-auth-library-oauth2-http:1.30.0"
google-cloud-bom = "com.google.cloud:libraries-bom:26.50.0"
google-cloud-firestore = { module = "com.google.cloud:google-cloud-firestore" }

google-firebase-admin = "com.google.firebase:firebase-admin:9.4.1"
google-firebase-bom = "com.google.firebase:firebase-bom:33.6.0"
google-firebase-appcheck-playintegrity = { module = "com.google.firebase:firebase-appcheck-playintegrity" }
google-firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics" }

google-guava-jre = "com.google.guava:guava:33.3.1-jre"

Expand Down Expand Up @@ -129,6 +128,7 @@ cash-sqldelight = { id = "app.cash.sqldelight", version.ref = "cash-sqldelight"
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "jetbrains-kotlin" }
dependency-analysis = "com.autonomousapps.dependency-analysis:2.3.0"
detekt = "io.gitlab.arturbosch.detekt:1.23.7"
crashlytics = "com.google.firebase.crashlytics:3.0.2"
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
gradle-doctor = "com.osacky.doctor:0.10.0"
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
Expand Down

0 comments on commit 1c15afe

Please sign in to comment.