2026-06-10 14:27:40 +02:00
|
|
|
import java.util.Properties
|
|
|
|
|
|
2026-06-10 13:31:39 +02:00
|
|
|
plugins {
|
|
|
|
|
alias(libs.plugins.android.application)
|
|
|
|
|
// AGP 9 has built-in Kotlin (org.jetbrains.kotlin.android is gone); only the
|
|
|
|
|
// compiler sub-plugins are applied separately, pinned to AGP's bundled KGP version.
|
|
|
|
|
alias(libs.plugins.kotlin.compose)
|
2026-06-10 13:54:13 +02:00
|
|
|
alias(libs.plugins.kotlin.serialization)
|
2026-06-10 13:34:41 +02:00
|
|
|
alias(libs.plugins.ksp)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ksp {
|
|
|
|
|
// Commit exported schemas: migration baseline for a DB that is a medical record.
|
|
|
|
|
arg("room.schemaLocation", "$projectDir/schemas")
|
2026-06-10 13:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
2026-06-10 14:27:40 +02:00
|
|
|
// Release signing from gitignored keystore.properties (keystore lives in
|
|
|
|
|
// ~/.keystores). Absent file → unsigned release, so CI/fresh clones still build.
|
|
|
|
|
val keystoreProps = Properties().apply {
|
|
|
|
|
val f = rootProject.file("keystore.properties")
|
|
|
|
|
if (f.exists()) f.inputStream().use(::load)
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-10 13:31:39 +02:00
|
|
|
android {
|
|
|
|
|
namespace = "no.naiv.meddetsamme"
|
|
|
|
|
// compileSdk 37: required by current AndroidX (core 1.19 / compose BOM 2026.05).
|
|
|
|
|
// targetSdk stays 35 (brief) — compile-against vs runtime-behavior are separate knobs.
|
|
|
|
|
compileSdk = 37
|
|
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
|
applicationId = "no.naiv.meddetsamme"
|
|
|
|
|
minSdk = 26
|
|
|
|
|
targetSdk = 35
|
|
|
|
|
versionCode = 1
|
|
|
|
|
versionName = "0.1.0"
|
2026-06-10 15:13:28 +02:00
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2026-06-10 13:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
2026-06-10 14:27:40 +02:00
|
|
|
signingConfigs {
|
|
|
|
|
if (keystoreProps.isNotEmpty()) {
|
|
|
|
|
create("release") {
|
|
|
|
|
storeFile = file(keystoreProps.getProperty("storeFile"))
|
|
|
|
|
storePassword = keystoreProps.getProperty("storePassword")
|
|
|
|
|
keyAlias = keystoreProps.getProperty("keyAlias")
|
|
|
|
|
keyPassword = keystoreProps.getProperty("keyPassword")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-10 13:31:39 +02:00
|
|
|
buildTypes {
|
|
|
|
|
release {
|
|
|
|
|
isMinifyEnabled = false
|
|
|
|
|
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"))
|
2026-06-10 14:27:40 +02:00
|
|
|
if (keystoreProps.isNotEmpty()) {
|
|
|
|
|
signingConfig = signingConfigs.getByName("release")
|
|
|
|
|
}
|
2026-06-10 13:31:39 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
|
// Built-in Kotlin derives jvmTarget from targetCompatibility — one knob, not two.
|
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
buildFeatures {
|
|
|
|
|
compose = true
|
|
|
|
|
}
|
2026-06-10 15:13:28 +02:00
|
|
|
|
|
|
|
|
// MigrationTestHelper reads the exported schema JSONs as androidTest assets.
|
|
|
|
|
sourceSets.getByName("androidTest").assets.srcDir("$projectDir/schemas")
|
2026-06-10 13:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dependencies {
|
2026-06-10 13:48:39 +02:00
|
|
|
implementation(libs.kotlinx.coroutines.android)
|
2026-06-10 13:31:39 +02:00
|
|
|
implementation(libs.androidx.core.ktx)
|
|
|
|
|
implementation(libs.androidx.activity.compose)
|
|
|
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
|
|
|
|
|
|
|
|
implementation(platform(libs.compose.bom))
|
|
|
|
|
implementation(libs.compose.ui)
|
|
|
|
|
implementation(libs.compose.material3)
|
|
|
|
|
implementation(libs.compose.ui.tooling.preview)
|
|
|
|
|
debugImplementation(libs.compose.ui.tooling)
|
|
|
|
|
|
2026-06-10 13:34:41 +02:00
|
|
|
implementation(libs.room.runtime)
|
|
|
|
|
ksp(libs.room.compiler)
|
|
|
|
|
|
2026-06-10 13:54:13 +02:00
|
|
|
implementation(libs.work.runtime)
|
|
|
|
|
implementation(libs.okhttp)
|
|
|
|
|
implementation(libs.kotlinx.serialization.json)
|
2026-06-10 14:00:34 +02:00
|
|
|
implementation(libs.kage)
|
2026-06-10 13:54:13 +02:00
|
|
|
|
2026-06-10 13:31:39 +02:00
|
|
|
testImplementation(libs.junit)
|
2026-06-10 15:13:28 +02:00
|
|
|
androidTestImplementation(libs.androidx.test.junit)
|
|
|
|
|
androidTestImplementation(libs.androidx.test.runner)
|
|
|
|
|
androidTestImplementation(libs.room.testing)
|
2026-06-10 13:31:39 +02:00
|
|
|
}
|