mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
chore(conductor): Add new track 'Migrate to Room 3.0'
This commit is contained in:
parent
6cdd10d936
commit
95653a4270
5 changed files with 82 additions and 0 deletions
|
|
@ -1,3 +1,8 @@
|
|||
# Project Tracks
|
||||
|
||||
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
|
||||
|
||||
---
|
||||
|
||||
- [ ] **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/)*
|
||||
|
|
|
|||
5
conductor/tracks/migrate_room3_20260320/index.md
Normal file
5
conductor/tracks/migrate_room3_20260320/index.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
# Track migrate_room3_20260320 Context
|
||||
|
||||
- [Specification](./spec.md)
|
||||
- [Implementation Plan](./plan.md)
|
||||
- [Metadata](./metadata.json)
|
||||
8
conductor/tracks/migrate_room3_20260320/metadata.json
Normal file
8
conductor/tracks/migrate_room3_20260320/metadata.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"track_id": "migrate_room3_20260320",
|
||||
"type": "chore",
|
||||
"status": "new",
|
||||
"created_at": "2026-03-20T00:00:00Z",
|
||||
"updated_at": "2026-03-20T00:00:00Z",
|
||||
"description": "Migrate to room3, prepare to support all targets (Android, Desktop, iOS) with bundled SQLite driver and full idiomatic migration."
|
||||
}
|
||||
36
conductor/tracks/migrate_room3_20260320/plan.md
Normal file
36
conductor/tracks/migrate_room3_20260320/plan.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# Implementation Plan - Room 3 Migration
|
||||
|
||||
## Phase 1: Dependency Update & Build Logic Refinement
|
||||
- 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)
|
||||
|
||||
## 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)
|
||||
|
||||
## 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)
|
||||
|
||||
## 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)
|
||||
28
conductor/tracks/migrate_room3_20260320/spec.md
Normal file
28
conductor/tracks/migrate_room3_20260320/spec.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Specification - Room 3 Migration
|
||||
|
||||
## Overview
|
||||
Migrate the existing database implementation from Room 2.8.x to Room 3.0. This migration aims to modernize the persistence layer by adopting Room's new Kotlin Multiplatform (KMP) capabilities, ensuring consistent behavior across Android, Desktop (JVM), and iOS targets. Following best practice from reference projects.
|
||||
|
||||
## Functional Requirements
|
||||
- **Room 3.0 Update**: Update all Room-related dependencies to version 3.0 (alpha/beta/stable as per latest).
|
||||
- **KMP Support**: Ensure `core:database` is fully compatible with Android, Desktop (JVM), and iOS targets.
|
||||
- **Bundled SQLite Driver**: Configure the project to use the `androidx.sqlite:sqlite-bundled` driver for all platforms to ensure consistent SQL behavior and versioning.
|
||||
- **Schema Management**: Maintain existing database schemas and ensure migrations (if any) are compatible with Room 3.
|
||||
- **DAO & Entity Optimization**: Refactor DAOs and Entities to use Room 3's idiomatic Kotlin APIs (e.g., using `RoomDatabase.Builder` for KMP).
|
||||
|
||||
## Non-Functional Requirements
|
||||
- **Performance**: Ensure no significant regression in database performance after the migration.
|
||||
- **Reliability**: All existing database tests must pass on Android.
|
||||
- **Maintainability**: Adopt the new Room Gradle plugin for schema export and generation.
|
||||
|
||||
## Acceptance Criteria
|
||||
1. All modules (`core:database`, `core:data`, etc.) build successfully with Room 3.0.
|
||||
2. Database initialization works correctly on Android and Desktop.
|
||||
3. Unit tests for DAOs pass in `commonTest` (where applicable) and `androidDeviceTest`.
|
||||
4. The `androidx.sqlite:sqlite-bundled` driver is used for database connections.
|
||||
5. iOS target is added to `core:database` (if not already present) and compiles.
|
||||
|
||||
## Out of Scope
|
||||
- Migrating to a different database engine (e.g., SQLDelight).
|
||||
- Major schema changes unrelated to the Room 3 migration.
|
||||
- Implementing complex iOS-specific UI related to the database.
|
||||
Loading…
Add table
Add a link
Reference in a new issue