Phase-0 recommendation #1 ("core:domain is already JVM-clean — convert it first; zero code changes"), now unlocked by M4.1: common source sets cannot see plain kotlin("jvm") projects, so the domain deploy was the gate for making composeApp's commonMain depend on Note/NoteColor/NoteRepository. Sources move untouched (pure renames); Flow moves implementation → api (it is in the public repository interfaces — was already leaking, now stated). androidTarget() drags in the AGP plugin + a namespace — the module is now a library-for-Android too, but emits no Android-specific code and needed no manifest (AGP 8 + namespace). Plain-JVM consumers (:core:data-jvm, :core:backup, :core:settings, :desktopApp) and AGP consumers (:core:data, :app) resolve through variant metadata with ZERO import or build-line changes — verified below. Then composeApp: api(project(":core:domain")) in commonMain (up from androidMain), NoteColors.kt moves to commonMain — first real shared UI-layer file with a domain dependency. Verified: ./gradlew assembleDebug + :composeApp:compileKotlinJvm + :core:data-jvm:smoke (M1a PASS) in one run, and :desktopApp:run --args="--data-dir /tmp/incido-desktop-smoke3 --self-test --exit-after 6" (SELFTEST wrote note id=1).
46 lines
1.3 KiB
Kotlin
46 lines
1.3 KiB
Kotlin
// core/domain — pure-Kotlin domain module (no Android dependencies).
|
|
// Contains business types and repository interfaces only.
|
|
// Implementation lives in :core:data.
|
|
//
|
|
// Phase 1 (M4.2): converted kotlin("jvm") → kotlin("multiplatform") with
|
|
// androidTarget() + jvm(), per the Phase-0 recommendation ("core:domain is
|
|
// already JVM-clean — convert it first. Zero code changes"). This is what
|
|
// lets a KMP module's commonMain (composeApp) depend on it — plain
|
|
// kotlin("jvm") modules are invisible to commonMain. Existing plain-JVM
|
|
// (:core:data-jvm, :desktopApp) and AGP (:core:data, :app, :composeApp)
|
|
// consumers keep working through the variant metadata — zero import
|
|
// changes anywhere.
|
|
plugins {
|
|
alias(libs.plugins.androidLibrary)
|
|
alias(libs.plugins.kotlinMultiplatform)
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
|
|
androidTarget()
|
|
jvm()
|
|
|
|
sourceSets {
|
|
commonMain.dependencies {
|
|
// Flow/StateFlow appear in the public repository interfaces.
|
|
api(libs.kotlinx.coroutines.core)
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "org.incido.domain"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
minSdk = 26
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
}
|
|
|