// 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) }