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:
Incido Developer committed 2026-10-06 12:20:05 +13:00
1 parent bce8e9a0dc
commit 9ad7c60537
12 files changed
+39 -9

No files matched your search

@@ -1,38 +0,0 @@
package org.incido.compose.ui.theme
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.graphics.Color
import org.incido.domain.model.NoteColor
/**
* Maps a [NoteColor] enum to a Compose [Color]. Values are chosen to
* stay readable against both light and dark surfaces.
*/
@Composable
@ReadOnlyComposable
fun NoteColor.toComposeColor(): Color = when (this) {
NoteColor.NONE -> Color.Transparent
NoteColor.BLUE -> Color(0xFF4A6FA5)
NoteColor.GREEN -> Color(0xFF4F8A5B)
NoteColor.AMBER -> Color(0xFFB8862B)
NoteColor.RED -> Color(0xFFB14B4B)
NoteColor.PURPLE -> Color(0xFF7B5BA6)
}
/** All selectable colours, including [NoteColor.NONE]. */
val AllNoteColors: List<NoteColor> = listOf(
NoteColor.NONE,
NoteColor.BLUE,
NoteColor.GREEN,
NoteColor.AMBER,
NoteColor.RED,
NoteColor.PURPLE,
)
/** Outline colour used to highlight the selected swatch. */
val swatchBorderColor: Color
@Composable
@ReadOnlyComposable
get() = MaterialTheme.colorScheme.outline