feat(phase-1/m4.2): :core:domain → multiplatform (androidTarget + jvm); NoteColors to commonMain
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).
This commit is contained in:
1 parent
bce8e9a0dc
commit
9ad7c60537
12 files changed
+39
-9
No files matched your search
@@ -48,10 +48,14 @@ kotlin {
|
|||||||
implementation(compose.foundation)
|
implementation(compose.foundation)
|
||||||
implementation(compose.material3)
|
implementation(compose.material3)
|
||||||
implementation(libs.kotlinx.coroutines.core)
|
implementation(libs.kotlinx.coroutines.core)
|
||||||
|
// 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"))
|
||||||
}
|
}
|
||||||
|
|
||||||
androidMain.dependencies {
|
androidMain.dependencies {
|
||||||
implementation(project(":core:domain"))
|
|
||||||
implementation(project(":core:data"))
|
implementation(project(":core:data"))
|
||||||
// Phase 1 (M2 task 1): backup codecs + bridge now live here; the
|
// Phase 1 (M2 task 1): backup codecs + bridge now live here; the
|
||||||
// org.incido.compose.data.backup package name was kept, so no imports
|
// org.incido.compose.data.backup package name was kept, so no imports
|
||||||
|
|||||||
File renamed without changes.
@@ -1,19 +1,45 @@
|
|||||||
// core/domain — pure-Kotlin domain module (no Android dependencies).
|
// core/domain — pure-Kotlin domain module (no Android dependencies).
|
||||||
// Contains business types and repository interfaces only.
|
// Contains business types and repository interfaces only.
|
||||||
// Implementation lives in :core:data.
|
// 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 {
|
plugins {
|
||||||
alias(libs.plugins.kotlinJvm)
|
alias(libs.plugins.androidLibrary)
|
||||||
}
|
alias(libs.plugins.kotlinMultiplatform)
|
||||||
|
|
||||||
java {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
jvmToolchain(17)
|
jvmToolchain(17)
|
||||||
|
|
||||||
|
androidTarget()
|
||||||
|
jvm()
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain.dependencies {
|
||||||
|
// Flow/StateFlow appear in the public repository interfaces.
|
||||||
|
api(libs.kotlinx.coroutines.core)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
android {
|
||||||
implementation(libs.kotlinx.coroutines.core)
|
namespace = "org.incido.domain"
|
||||||
|
compileSdk = 35
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdk = 26
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user