feat(phase-1/m2.1): :core:backup — codecs + stream-based BackupBridge
Phase 1 M2 task 1 (tools/DESKTOP_PHASE_PLAN.md §4): extract the backup
bridge from :composeApp into a plain kotlin("jvm") module so the desktop
build can import/export the phone file format.
- git mv BackupCodec / EncryptedBackupCodec / EncryptedKeyCodec into
core/backup, keeping the org.incido.compose.data.backup package so the
Android diff is file moves + one dependency line (no import churn).
- New BackupBridge: the four BackupManager operations over
InputStream/OutputStream instead of Uri (incl. the v0.3.3.3 preview
hotfix catches); BackupPreview moves with it, same package.
- BackupManager stays in :composeApp as a thin Uri -> stream SAF shim,
public API unchanged. Dedupe = task 3, desktop picker UI = task 2.
Verification passed: ./gradlew :core:backup:build :core:data-jvm:smoke
:spike:data-jvm:run + assembleDebug + :desktopApp:run --args="--data-dir
/tmp/incido-desktop-smoke --self-test --exit-after 6" — all green; run
output recorded in tools/DESKTOP_FEASIBILITY.md (Phase 1 status).
This commit is contained in:
1 parent
b11c02e1b4
commit
7cc4eda90d
9 files changed
+262
-92
No files matched your search
@@ -0,0 +1,34 @@
|
||||
// core/backup — Phase 1 (M2 task 1): the backup bridge, extracted from
|
||||
// :composeApp so the desktop build can speak the phone's file format.
|
||||
//
|
||||
// Everything here is pure JVM/kotlinx (verified by reading the code in the
|
||||
// Phase-0 spike: zero android.* imports in the codecs). The package name
|
||||
// stays org.incido.compose.data.backup so the Android diff is file moves
|
||||
// only — no import churn in composeApp.
|
||||
//
|
||||
// Shape follows :core:domain (plain kotlin("jvm"), consumed by both the
|
||||
// Android app and the desktop app). No ObjectBox here: the codec talks to
|
||||
// the app only through the NoteRepository interface from :core:domain.
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinJvm)
|
||||
// @Serializable DTOs (BackupFile / BackupNote / BackupAttachment) live in
|
||||
// BackupCodec.kt — the plugin generates their serializers here.
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
}
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Public API speaks domain types (Note, NoteRepository) — api, not impl.
|
||||
api(project(":core:domain"))
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
}
|
||||
Reference in new issue
Block a user