Add crashlytics (#87)
* Add crashlytics * Add google services json to ci env
This commit is contained in:
parent
efaa8efc2c
commit
9306ba29cb
1
.github/workflows/android.yml
vendored
1
.github/workflows/android.yml
vendored
@ -25,6 +25,7 @@ jobs:
|
||||
echo "KEY_PASSWORD=${{ secrets.KEY_PASSWORD }}" >> $GITHUB_ENV
|
||||
echo "KEYSTORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }}" >> $GITHUB_ENV
|
||||
echo "KEYSTORE_BASE64=${{ secrets.KEYSTORE_BASE64 }}" >> $GITHUB_ENV
|
||||
echo "GOOGLE_SERVICES_JSON_BASE64=${{ secrets.GOOGLE_SERVICES_JSON_BASE64 }}" >> $GITHUB_ENV
|
||||
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
|
||||
- uses: actions/checkout@v4
|
||||
- name: set up JDK 17
|
||||
|
||||
@ -57,6 +57,10 @@ If the app cannot connect to the weather service, it will retry the download eve
|
||||
- Interfaces with [openweathermap.org](https://openweathermap.org)
|
||||
- Uses [karoo-ext](https://github.com/hammerheadnav/karoo-ext) (Apache2-licensed)
|
||||
|
||||
## Crashlytics
|
||||
|
||||
This app uses Google Crashlytics for crash reporting to help improve stability and performance.
|
||||
|
||||
## Extension Developers: Headwind Data Type
|
||||
|
||||
If the user has installed the headwind extension on his karoo, you can stream the headwind data type from other extensions via `karoo-ext`.
|
||||
|
||||
3
app/.gitignore
vendored
3
app/.gitignore
vendored
@ -1 +1,2 @@
|
||||
/build
|
||||
/build
|
||||
/google-services.json
|
||||
|
||||
@ -5,6 +5,8 @@ plugins {
|
||||
alias(libs.plugins.jetbrains.kotlin.android)
|
||||
alias(libs.plugins.compose.compiler)
|
||||
kotlin("plugin.serialization") version "2.0.20"
|
||||
alias(libs.plugins.google.gms.google.services)
|
||||
alias(libs.plugins.google.firebase.crashlytics)
|
||||
}
|
||||
|
||||
android {
|
||||
@ -55,6 +57,24 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("addGoogleServicesJson") {
|
||||
description = "Adds google-services.json to the project"
|
||||
group = "build"
|
||||
|
||||
doLast {
|
||||
val googleServicesJson = System.getenv("GOOGLE_SERVICES_JSON_BASE64")
|
||||
?.let { Base64.getDecoder().decode(it) }
|
||||
?.let { String(it) }
|
||||
if (googleServicesJson != null) {
|
||||
val jsonFile = file("$projectDir/google-services.json")
|
||||
jsonFile.writeText(googleServicesJson)
|
||||
println("Added google-services.json to the project")
|
||||
} else {
|
||||
println("No GOOGLE_SERVICES_JSON_BASE64 environment variable found, skipping...")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("generateManifest") {
|
||||
description = "Generates manifest.json with current version information"
|
||||
group = "build"
|
||||
@ -85,6 +105,7 @@ tasks.register("generateManifest") {
|
||||
|
||||
tasks.named("assemble") {
|
||||
dependsOn("generateManifest")
|
||||
dependsOn("addGoogleServicesJson")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@ -99,4 +120,5 @@ dependencies {
|
||||
implementation(libs.androidx.glance.appwidget)
|
||||
implementation(libs.androidx.glance.appwidget.preview)
|
||||
implementation(libs.androidx.glance.preview)
|
||||
implementation(libs.firebase.crashlytics)
|
||||
}
|
||||
@ -3,4 +3,6 @@ plugins {
|
||||
alias(libs.plugins.android.application) apply false
|
||||
alias(libs.plugins.jetbrains.kotlin.android) apply false
|
||||
alias(libs.plugins.compose.compiler) apply false
|
||||
alias(libs.plugins.google.gms.google.services) apply false
|
||||
alias(libs.plugins.google.firebase.crashlytics) apply false
|
||||
}
|
||||
@ -11,11 +11,16 @@ androidxComposeMaterial = "1.3.1"
|
||||
glance = "1.1.1"
|
||||
kotlinxSerializationJson = "1.8.0"
|
||||
mapboxSdkTurf = "7.3.1"
|
||||
firebaseCrashlytics = "19.4.2"
|
||||
googleGmsGoogleServices = "4.4.2"
|
||||
googleFirebaseCrashlytics = "3.0.3"
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||
google-gms-google-services = { id = "com.google.gms.google-services", version.ref = "googleGmsGoogleServices" }
|
||||
google-firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "googleFirebaseCrashlytics" }
|
||||
|
||||
[libraries]
|
||||
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastorePreferences" }
|
||||
@ -38,6 +43,7 @@ androidx-glance-appwidget-preview = { group = "androidx.glance", name = "glance-
|
||||
androidx-glance-preview = { group = "androidx.glance", name = "glance-preview", version.ref = "glance" }
|
||||
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
|
||||
mapbox-sdk-turf = { module = "com.mapbox.mapboxsdk:mapbox-sdk-turf", version.ref = "mapboxSdkTurf" }
|
||||
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics", version.ref = "firebaseCrashlytics" }
|
||||
|
||||
[bundles]
|
||||
androidx-lifeycle = ["androidx-lifecycle-runtime-compose", "androidx-lifecycle-viewmodel-compose"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user