Phase 1 M2 task 2 (tools/DESKTOP_PHASE_PLAN.md §4): :desktopApp can now speak the phone's backup format through the extracted bridge. - New BackupActions.kt: top-bar overflow menu (Import from file… / Export plain / Export encrypted). Import = AWT FileDialog -> BackupBridge.preview -> passphrase dialog on INCDBK1 (wrong passphrase stays open for retry) -> BackupPreview confirm dialog -> import. Export = save-picker -> exportPlain / passphrase + exportEncrypted. All heavy bridge calls run on Dispatchers.IO; results via Snackbar. - Same package-level BackupBridge calls Android's BackupManager shim makes — format shared by construction, not reimplementation. Android's PassphraseDialog.kt deliberately NOT ported (M4 moves the real one to common code). - :desktopApp gains implementation(:core:backup). - Scripted headless path for CI: --backup-import/--backup-export drive the identical bridge calls without dialog clicking. Verification passed: :desktopApp:run --args="--data-dir /tmp/... --backup-import <real phone export> --backup-export /tmp/m2t4-exp.json --exit-after 8" (preview 27 / imported 27 / exported 27, clean exit) + :core:data-jvm:backupSmoke on the DESKTOP-written export (all PASS) + python cross-check: notes (createdAt,updatedAt,content) and attachment Base64 identical phone->desktop->phone + assembleDebug + :core:data-jvm:smoke + :desktopApp:run --self-test — all green. Output recorded in DESKTOP_FEASIBILITY.md (incl. one unreproduced first-run exit hang to watch in M5).
53 lines
2.0 KiB
Kotlin
53 lines
2.0 KiB
Kotlin
// desktopApp — Incido for the desktop (Development Plan §6, Phase 1, M1b).
|
|
//
|
|
// A Compose Multiplatform window over :core:data-jvm, i.e. the SAME data layer
|
|
// the Android app compiles (shared sources, sibling ObjectBox codegen). The
|
|
// desktop build owns its own library in the XDG data dir; the encrypted backup
|
|
// file is the only bridge to the phone (M2) because ObjectBox is single-writer.
|
|
|
|
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
|
|
|
|
plugins {
|
|
alias(libs.plugins.kotlinJvm)
|
|
alias(libs.plugins.compose)
|
|
alias(libs.plugins.kotlinCompose)
|
|
// SPIKE FINDING: the `application` plugin is NOT applied explicitly —
|
|
// org.jetbrains.compose applies it itself, and applying it first collides
|
|
// on task registration. `compose.desktop { application { } }` gives `run`.
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|
|
|
|
dependencies {
|
|
implementation(compose.desktop.currentOs)
|
|
implementation(compose.ui)
|
|
implementation(compose.foundation)
|
|
implementation(compose.material3)
|
|
implementation(compose.materialIconsExtended)
|
|
implementation(libs.kotlinx.coroutines.core)
|
|
implementation(libs.kotlinx.coroutines.swing)
|
|
|
|
implementation(project(":core:domain"))
|
|
implementation(project(":core:data-jvm"))
|
|
// Phase 1 (M2 task 2): the backup bridge — the desktop "Import from
|
|
// file… / Export" menu speaks the phone's format through it.
|
|
implementation(project(":core:backup"))
|
|
}
|
|
|
|
// Packaging works (proven in Phase 0), but per-OS installers and icons are
|
|
// milestone M5. Version is pinned numerically here because jpackage only
|
|
// accepts major.minor.patch; M5 wires it to the app's version scheme.
|
|
compose.desktop {
|
|
application {
|
|
mainClass = "org.incido.desktop.MainKt"
|
|
nativeDistributions {
|
|
targetFormats(TargetFormat.Deb, TargetFormat.Rpm, TargetFormat.AppImage)
|
|
packageName = "incido"
|
|
packageVersion = "0.4.2"
|
|
vendor = "Incido"
|
|
description = "Incido — offline-first notes (desktop)."
|
|
}
|
|
}
|
|
} |