feat(phase-1/m4.3b): AppGraph seam + first commonMain ViewModel (§6.4 probe GREEN)
M4.3's container seam, proven with the smallest ViewModel: * commonMain di/AppGraph.kt — the platform-neutral container face (noteRepository + settingsRepository) plus LocalAppGraph / requireAppGraph. Scope discipline per §9: only services BOTH platforms can honestly serve; Keystore/SecurityManager/BackupManager/CarnetImporter stay on the concrete AppContainer. * :core:settings + lifecycle-viewmodel enter commonMain (settings as api — AppGraph exposes it). Lifecycle coordinates are the SAME org.jetbrains.androidx.lifecycle 2.8.4 aliases androidMain already resolved since M4.1, so the §6.4 "verify the artifact set" question is answered GREEN for both targets and the state-holder fallback is NOT needed: DrawerViewModel moves with its androidx.lifecycle.* imports UNCHANGED (offline set keeps the androidx FQCNs). * DrawerViewModel.Factory(APPLICATION_KEY as IncidoApplication) → factory(graph: AppGraph). AppContainer implements AppGraph; IncidoApp provides LocalAppGraph at the root (same fallback chain it already used). Verification (one run): ./gradlew :composeApp:compileKotlinJvm assembleDebug → BUILD SUCCESSFUL (jvm target = first compile of a commonMain ViewModel on desktop deps)
This commit is contained in:
1 parent
5bce1934c1
commit
cd363c7aa5
6 files changed
+230
-156
No files matched your search
@@ -47,11 +47,24 @@ kotlin {
|
||||
implementation(compose.foundation)
|
||||
implementation(compose.material3)
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
// Phase 1 (M4.3b): the §6.4 artifact check resolves GREEN —
|
||||
// these org.jetbrains.androidx.lifecycle coordinates are what
|
||||
// androidMain has been resolving since M4.1 (assembleDebug
|
||||
// proves they coexist with the AndroidX BOM on the android
|
||||
// target), and the desktopApp runtime already carried the
|
||||
// matching -desktop jars. Here they enter commonMain so the
|
||||
// ViewModels move with their `androidx.lifecycle.*` imports
|
||||
// UNCHANGED (the offline set keeps the androidx FQCNs).
|
||||
implementation(libs.androidx.lifecycle.viewmodel)
|
||||
// Phase 1 (M4.2): :core:domain is multiplatform now (M4.2's own
|
||||
// conversion), so commonMain can see it — this is what let
|
||||
// NoteColors.kt move up. api: screens/ViewModels across all
|
||||
// targets consume Note/NoteColor/NoteRepository from it.
|
||||
api(project(":core:domain"))
|
||||
// Phase 1 (M4.3a): :core:settings converted in the same shape —
|
||||
// M4.3's AppGraph exposes SettingsRepository/UserSettings to
|
||||
// commonMain, so this has to be api too.
|
||||
api(project(":core:settings"))
|
||||
}
|
||||
|
||||
androidMain.dependencies {
|
||||
|
||||
Reference in new issue
Block a user