feat(phase-1/m4.1): :composeApp in-place → Kotlin Multiplatform (androidTarget + jvm)

Plan §6.1 step 1, the conservative shape: build converts, Android code
moves UNMODIFIED (git shows pure renames; behaviour diff = zero), and
commonMain starts with only the files that compile for both targets
today — theme Color/Type, PasswordPolicy, ReleaseNotes, LinkedShare-
Composer — behind two new expect/actual seams (justification per §9):

* platformDynamicColorScheme — Android actual keeps the pre-M4
  Build.VERSION + dynamicColorScheme branch verbatim; JVM actual
  returns null (desktop hides dynamic color, per M3's posture).
* relativeTimestamp — Android actual is DateUtils verbatim; JVM
  actual is a java.time approximation of the same format (English-
  only until M4 follow-up; desktop has no locale switch yet).

New friction found paying itself into §3/§2 (all fixed in-tree):
* kotlinMultiplatform must be registered at the ROOT with apply false
  like the other Kotlin markers — sibling modules' markers put KGP on
  the buildscript classpath and the subproject request then dies with
  the kapt-style 'already on classpath with unknown version' (§2.5).
* KMP source-set dependency handlers: platform(libs.x) returns raw
  notation, not a Dependency — use project.dependencies.platform(…);
  debugImplementation is not on the handler (moved to a project-level
  dependencies block); androidTestImplementation dropped (no tests).
* ColorScheme is androidx.compose.material3.ColorScheme, NOT
  ui.graphics — desktop ships it inside material3-desktop, no extra
  artifact needed.
* AGP 8.7.2 > KGP 2.0.21's tested max 8.5 — warning only, same as
  the kapt modules; assembleDebug green.

Deliberate deferrals (documented in the build file): :core:domain is
still kotlin("jvm") so commonMain can't see it — NoteColors moves
when domain converts (M4.2, per the Phase-0 recommendation); screens,
ViewModels and AppContainer move with the container seam (M4.3).

Verified: ./gradlew :composeApp:compileKotlinJvm + assembleDebug +
:core:data-jvm:smoke (M1a PASS) + :desktopApp:run --self-test
(SELFTEST wrote note, clean exit) + git status clean over
core/**/objectbox-models (ID model file unchanged, invariant 2).
This commit is contained in:
Incido Developer committed 2026-10-06 12:15:15 +13:00
1 parent 6b8db18cdf
commit fef8f9c2e9
43 files changed
+229 -83

No files matched your search

@@ -0,0 +1,34 @@
package org.incido.compose
import android.app.Application
import org.incido.compose.data.security.SecurityManager
import org.incido.compose.di.AppContainer
/**
* Application class. Constructs the singleton [AppContainer] holding the
* ObjectBox store and the note repository.
*
* ViewModels reach the container via `(application as IncidoApplication).container`
* (see `NoteListViewModel.Factory` and `NoteEditorViewModel.factory`).
*
* v0.3.2.0 — initialises the [SecurityManager] lock state during
* `onCreate` so the first composition of the root Compose tree
* already knows whether to render `PinEntryScreen` or jump straight
* into the regular UI.
*/
class IncidoApplication : Application() {
lateinit var container: AppContainer
private set
val securityManager: SecurityManager
get() = container.securityManager
override fun onCreate() {
super.onCreate()
container = AppContainer(this)
// Decide whether to start locked based on the persisted
// security preferences. Safe here — no UI thread contention
// because we're on the main thread pre-Activity.
container.securityManager.start()
}
}