Files
Incido/spike/data-jvm/build.gradle.kts
T
Incido Developer 8b66e82acb spike(desktop): Phase 0 feasibility probes + findings
Adds the throwaway Phase-0 spike (Development Plan §6.3) that answers
whether Incido can become a Compose Multiplatform desktop app without
abandoning ObjectBox, its crypto layer, or its UI layer. All six
questions came back PASS; findings live in tools/DESKTOP_FEASIBILITY.md.

  :spike:data-jvm    ObjectBox kapt codegen + native runtime on a plain
                     JVM, DataStore Preferences without a Context, and
                     the app's own EncryptedKeyCodec round-tripping.
  :spike:compose-jvm Compose Desktop rendering the app's real theme
                     layer + core:domain, plus jpackage packaging.

Additive only: nothing outside spike/ depends on these, and the Android
build is untouched (assembleDebug verified green).
2026-10-05 18:20:46 +13:00

71 lines
2.6 KiB
Kotlin

// spike/data-jvm — THROWAWAY probe, not shipped. Desktop feasibility spike S1
// (Development Plan §6.3). Answers Q2 + Q3:
// Q2: does the ObjectBox generator + native runtime work on a plain JVM?
// Q3: which data-module shape can Phase 1 use — one KMP module, or sibling
// JVM/Android modules? This module is the "sibling JVM module" shape,
// with the four entities copied verbatim from :core:data.
//
// Delete with the rest of `spike/` + its two `include()` lines in
// settings.gradle.kts. Findings live in tools/DESKTOP_FEASIBILITY.md.
// The ObjectBox Gradle plugin publishes no plugin marker (same reason
// :core/data/build.gradle.kts wires it through a buildscript classpath).
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:${libs.versions.objectbox.get()}")
}
}
plugins {
alias(libs.plugins.kotlinJvm)
application
}
// SPIKE FINDING: `alias(libs.plugins.kotlinKapt)` fails here with "plugin is
// already on the classpath with an unknown version" because the root build
// script already loads the Kotlin Gradle Plugin (kapt ships inside it).
// Applying it by id — no version — reuses that copy. Same applies to Phase 1:
// any JVM/KMP module needs kapt this way, or the root must declare
// `alias(libs.plugins.kotlinKapt) apply false`.
apply(plugin = "org.jetbrains.kotlin.kapt")
// Applied after the java/application plugins, as ObjectBox requires.
apply(plugin = "io.objectbox")
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
jvmToolchain(17)
}
application {
mainClass.set("org.incido.spike.data.MainKt")
}
dependencies {
// The existing pure-Kotlin domain module — consumed as-is, no changes.
implementation(project(":core:domain"))
implementation(libs.kotlinx.coroutines.core)
// JVM counterparts of objectbox-android / the AAR the Android app uses.
implementation(libs.objectbox.java)
implementation(libs.objectbox.kotlin)
// Q5a: the multiplatform half of the settings layer. The Android app uses
// the `preferencesDataStore(name = …)` Context extension; desktop must
// build the same Preferences store from a file path instead.
implementation(libs.androidx.datastore.preferences.core)
// Native database library for the target OS. The plugin auto-adds the
// one for the *build* machine only; declaring it keeps the probe honest
// about what a packaged desktop app must bundle.
runtimeOnly(libs.objectbox.linux)
}