First Android-library module in the kit. Privacy-respecting crash capture (writes a self-contained, allowlist-only report to private storage, chains to the platform handler, uploads nothing), startup crash-loop detection, a report dialog showing the full text before it leaves the device, and an issue-tracker hand-off. Extracted from Calendula and generalised: app label + issue URLs come from a CrashConfig supplied at install(); each app keeps its own thin themed CrashReportActivity. Lean deps (Compose + core-ktx). 3 unit tests on the pure report builder. Adds AGP/android-library + compose plugins and the compose/core-ktx libs to the kit catalog; core-time stays a plain JVM module. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
1.6 KiB
Kotlin
59 lines
1.6 KiB
Kotlin
// core-crash — privacy-respecting, on-device crash capture + a report dialog and
|
|
// issue-tracker hand-off, shared across the family. The reusable machinery lives
|
|
// here; each app keeps a thin themed CrashReportActivity and supplies a
|
|
// [CrashConfig] (app label + issue-tracker URLs) at install time.
|
|
//
|
|
// First Android-library module in the kit. Deliberately lean: Compose + core-ktx
|
|
// only, no buildConfig, no extra-icons dependency.
|
|
plugins {
|
|
// AGP 9.x provides built-in Kotlin compilation, so only the Compose plugin is
|
|
// applied alongside the Android library plugin (matches the apps' setup).
|
|
alias(libs.plugins.android.library)
|
|
alias(libs.plugins.kotlin.compose)
|
|
}
|
|
|
|
android {
|
|
namespace = "de.jeanlucmakiola.floret.crash"
|
|
compileSdk = 37
|
|
|
|
defaultConfig {
|
|
minSdk = 29
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
}
|
|
|
|
testOptions {
|
|
unitTests {
|
|
all { it.useJUnitPlatform() }
|
|
isReturnDefaultValues = true
|
|
}
|
|
}
|
|
}
|
|
|
|
kotlin {
|
|
compilerOptions {
|
|
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.core.ktx)
|
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.ui)
|
|
implementation(libs.androidx.foundation)
|
|
implementation(libs.androidx.material3)
|
|
|
|
testImplementation(libs.junit.jupiter.api)
|
|
testRuntimeOnly(libs.junit.jupiter.engine)
|
|
testRuntimeOnly(libs.junit.platform.launcher)
|
|
testImplementation(libs.truth)
|
|
}
|