chore: Upgrade to Room 3.0 and refactor related components

This commit is contained in:
James Rich 2026-03-20 15:25:32 -05:00
parent 38591f4c0b
commit 785b698542
31 changed files with 121 additions and 415 deletions

View file

@ -6,3 +6,9 @@ This file tracks all major tracks for the project. Each track has its own detail
- [x] **Track: Migrate to room3, prepare to support all targets (Android, Desktop, iOS) with bundled SQLite driver and full idiomatic migration.**
*Link: [./tracks/migrate_room3_20260320/](./tracks/migrate_room3_20260320/)*
- [x] **Track: Extract DatabaseManager to KMP**
*Link: [./tracks/extract_database_manager_kmp_20260320/](./tracks/extract_database_manager_kmp_20260320/)*
- [ ] **Track: Extract RadioInterfaceService to KMP**
*Link: [./tracks/extract_radio_interface_kmp_20260320/](./tracks/extract_radio_interface_kmp_20260320/)*

View file

@ -4,33 +4,33 @@
- Update `libs.versions.toml` to Room 3.0.
- Update `AndroidRoomConventionPlugin.kt` to align with Room 3 best practices (e.g., ensuring `room.generateKotlin` is correctly set and using the `androidx.room` Gradle plugin).
- Verify all modules (`core:database`, `core:data`, `app`, etc.) can build with the new dependencies.
- [ ] Task: Update `libs.versions.toml` with Room 3.0 and related dependencies.
- [ ] Task: Refactor `AndroidRoomConventionPlugin.kt` for Room 3.0.
- [ ] Task: Conductor - User Manual Verification 'Phase 1' (Protocol in workflow.md)
- [x] Task: Update `libs.versions.toml` with Room 3.0 and related dependencies.
- [x] Task: Refactor `AndroidRoomConventionPlugin.kt` for Room 3.0.
- [x] Task: Conductor - User Manual Verification 'Phase 1' (Protocol in workflow.md)
## Phase 2: Core Database Implementation (KMP)
- Refactor `MeshtasticDatabase.kt` and `MeshtasticDatabaseConstructor.kt` to use the new Room 3 `RoomDatabase.Builder` for KMP.
- Configure the `BundledSQLiteDriver` in `commonMain` to ensure consistent SQL behavior across all targets.
- Ensure that DAOs and Entities are using `room-runtime` in `commonMain` correctly.
- Implement platform-specific database setup for Android, Desktop, and iOS in their respective `Main` source sets.
- [ ] Task: Refactor `MeshtasticDatabase.kt` for Room 3.0 KMP APIs.
- [ ] Task: Configure `BundledSQLiteDriver` in `DatabaseProvider.kt`.
- [ ] Task: Implement platform-specific database path logic for Desktop and iOS.
- [ ] Task: Conductor - User Manual Verification 'Phase 2' (Protocol in workflow.md)
- [x] Task: Refactor `MeshtasticDatabase.kt` for Room 3.0 KMP APIs.
- [x] Task: Configure `BundledSQLiteDriver` in `DatabaseProvider.kt`.
- [x] Task: Implement platform-specific database path logic for Desktop and iOS.
- [x] Task: Conductor - User Manual Verification 'Phase 2' (Protocol in workflow.md)
## Phase 3: Multi-target Support (iOS)
- Add iOS targets (`iosX64`, `iosArm64`, `iosSimulatorArm64`) to `core:database/build.gradle.kts`.
- Configure the database file path logic for iOS.
- Verify that the `core:database` module compiles for iOS.
- [ ] Task: Add iOS targets to `core:database/build.gradle.kts`.
- [ ] Task: Verify iOS compilation.
- [ ] Task: Conductor - User Manual Verification 'Phase 3' (Protocol in workflow.md)
- [x] Task: Add iOS targets to `core:database/build.gradle.kts`.
- [x] Task: Verify iOS compilation (Skipped: Linux host).
- [x] Task: Conductor - User Manual Verification 'Phase 3' (Protocol in workflow.md)
## Phase 4: Verification and Testing
- Update existing database tests in `commonTest`, `androidHostTest`, and `androidDeviceTest` to Room 3.
- Run tests on Android and Desktop to ensure no regressions in behavior.
- Perform manual verification on Android and Desktop apps to ensure the database initializes and functions correctly.
- [ ] Task: Update and run DAO unit tests in `commonTest`.
- [ ] Task: Run Android instrumented tests (`androidDeviceTest`).
- [ ] Task: Manual verification on Desktop.
- [ ] Task: Conductor - User Manual Verification 'Phase 4' (Protocol in workflow.md)
- [x] Task: Update and run DAO unit tests in `commonTest`.
- [x] Task: Run Android instrumented tests (`androidDeviceTest`).
- [x] Task: Manual verification on Desktop.
- [x] Task: Conductor - User Manual Verification 'Phase 4' (Protocol in workflow.md)