Files
Incido/composeApp/build.gradle.kts
T
Incido Developer 8db835640e feat(phase-1/m3.1): :core:settings — SettingsRepository shared, store injected
Milestone M3 task 1 (DESKTOP_PHASE_PLAN §5): move UserSettings +
SettingsRepository into a plain kotlin("jvm") module so the desktop
build reads/writes the SAME preferences keys and .preferences_pb format
the phone uses. Package name org.incido.compose.data.settings kept, so
the Android diff is file moves + one constructor change.

Seam: SettingsRepository now takes an injected DataStore<Preferences>.
Android supplies the preferencesDataStore(name = "incido_settings")
Context-extension store (new AndroidSettingsStore.kt, moved verbatim);
desktop builds it with PreferenceDataStoreFactory.create(
corruptionHandler = ReplaceFileCorruptionHandler, produceFile) — the
Phase-0 API delta (no Context extension on the multiplatform core
artifact). snapshot() keeps runBlocking for startup-only use.

DesktopContainer grows settingsRepository first, mirroring AppContainer
construction order ahead of M3's cipher install. dynamic_color /
use_biometric / block_screenshots keys ride along but have no desktop
UI — hidden, not faked (M3 exit rule).

Verified: ./gradlew assembleDebug (green; :app needed :core:settings on
its classpath — MainActivity reads userSettingsFlow, same pattern as
:core:domain) + ./gradlew :desktopApp:run --args="--data-dir
/tmp/incido-desktop-smoke --self-test --exit-after 6" (RENDER/SELFTEST
sequence intact) + ./gradlew :core:data-jvm:smoke (green).
2026-10-06 06:20:13 +13:00

84 lines
2.7 KiB
Kotlin

// composeApp — Android UI module hosting all screens, ViewModels, theme,
// navigation, and the manual DI container. Regular Android Compose (not
// Compose Multiplatform) is used in v0.1 to keep the build simple; the
// migration path to Multiplatform in v0.2 is a module-level refactor.
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.kotlinCompose)
// v0.3.2.0 — Kotlin Serialization for the Backup JSON codec.
alias(libs.plugins.kotlinSerialization)
}
android {
namespace = "org.incido.compose"
compileSdk = 35
defaultConfig {
minSdk = 26
}
buildFeatures {
compose = true
buildConfig = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
dependencies {
implementation(project(":core:domain"))
implementation(project(":core:data"))
// Phase 1 (M2 task 1): backup codecs + bridge now live here; the
// org.incido.compose.data.backup package name was kept, so no imports
// changed — only this dependency line.
implementation(project(":core:backup"))
// Phase 1 (M3 task 1): settings repository, same treatment — package
// kept, the Context-based construction moved to AndroidSettingsStore.kt.
implementation(project(":core:settings"))
// Core / lifecycle
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.runtime)
implementation(libs.androidx.lifecycle.process)
implementation(libs.kotlinx.coroutines.android)
// Compose BOM keeps all Compose artefact versions aligned
val composeBom = platform(libs.composeBom)
implementation(composeBom)
androidTestImplementation(composeBom)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.navigation.compose)
// Compose
implementation(libs.compose.ui)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.compose.foundation)
implementation(libs.compose.material3)
implementation(libs.compose.material.icons.extended)
debugImplementation(libs.compose.ui.tooling)
// v0.3.2.0 — Settings (DataStore Preferences), Security (Biometric),
// and Backup (Kotlin Serialization JSON) support.
implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.biometric)
implementation(libs.kotlinx.serialization.json)
}