feat: Migrate project to Kotlin Multiplatform (KMP) architecture#4738
feat: Migrate project to Kotlin Multiplatform (KMP) architecture#4738jamesarich merged 2 commits intomainfrom
Conversation
This commit initiates a major architectural shift by migrating core modules and features toward Kotlin Multiplatform (KMP). Business logic, repositories, and ViewModels are being moved to `commonMain` to decouple the application from the Android framework and facilitate future platform expansion. Key changes include: - **Core BLE Refactoring:** - Introduced platform-agnostic BLE interfaces (`BleDevice`, `BleScanner`, `BleConnection`) in `commonMain`. - Moved Android-specific Nordic BLE implementations to `androidMain` and wrapped them behind the new interfaces. - Refactored `BleOtaTransport` and `NordicBleInterface` to use the decoupled BLE abstractions. - **Feature Migration (Map, Messaging, Intro):** - Converted `feature:map`, `feature:messaging`, and `feature:intro` to KMP library modules. - Moved core ViewModels (`MessageViewModel`, `ContactsViewModel`, `BaseMapViewModel`, `IntroViewModel`) to `commonMain`. - Implemented Android-specific Hilt ViewModel wrappers in the `app` module to maintain Dependency Injection compatibility. - Relocated platform-specific UI components (e.g., Map implementations, permission screens) to `androidMain`. - **UI & Resource Decoupling:** - Introduced `MapViewProvider` and other provider interfaces to inject flavored UI components (Google Maps vs. osmdroid) into common code via `CompositionLocal`. - Migrated `BarcodeScanner` and `AnalyticsIntro` to a provider-based pattern. - Moved various resources and Android-specific implementations from features into the main `app` module. - **Infrastructure & Maintenance:** - Updated `AGENTS.md` and `README.md` to reflect the new KMP vision and development guidelines. - Updated build logic and dependencies to support KMP and KSP. - Moved Hilt modules from library modules to the `app` module to resolve KSP generation issues in multi-flavor KMP modules. Specific changes: - Renamed and relocated dozens of files to align with `commonMain` vs `androidMain` source set structures. - Replaced `hiltViewModel()` calls in library modules with explicit ViewModel parameters to support better testing and platform independence. - Updated `MainActivity` to provide flavored implementations through `CompositionLocalProvider`. Signed-off-by: James Rich <[email protected]>
There was a problem hiding this comment.
Pull request overview
Initiates a large-scale migration toward a Kotlin Multiplatform (KMP) architecture by moving business logic/ViewModels into commonMain, introducing platform-agnostic BLE abstractions, and decoupling flavored UI (Maps, barcode/NFC, analytics intro) via provider interfaces and CompositionLocals.
Changes:
- Refactors BLE to use new common interfaces (
BleDevice,BleScanner,BleConnection, etc.) with Android implementations behind them. - Migrates Map/Messaging/Intro features toward KMP modules and replaces in-feature
hiltViewModel()calls with app-level Android wrapper ViewModels. - Introduces provider-based UI injection (
LocalMapViewProvider, barcode/NFC providers, analytics intro provider) and updates app wiring.
Reviewed changes
Copilot reviewed 134 out of 163 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapScreen.kt | Switches traceroute map rendering to LocalMapViewProvider. |
| feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/ui/contact/ContactsViewModel.kt | Removes Hilt annotations; makes ViewModel extensible for Android wrappers. |
| feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/QuickChatViewModel.kt | Removes Hilt annotations; makes ViewModel extensible for Android wrappers. |
| feature/messaging/src/commonMain/kotlin/org/meshtastic/feature/messaging/MessageViewModel.kt | Removes Hilt annotations; makes ViewModel extensible for Android wrappers. |
| feature/messaging/src/androidUnitTest/kotlin/org/meshtastic/feature/messaging/HomoglyphCharacterTransformTest.kt | Adds unit tests for homoglyph UTF-8 optimization. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/ui/sharing/Share.kt | Removes hiltViewModel() default; requires explicit VM injection. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/ui/contact/Contacts.kt | Removes hiltViewModel() default; requires explicit VM injection. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/ui/contact/AdaptiveContactsScreen.kt | Threads Contacts/Message ViewModels explicitly through adaptive UI. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/component/MessageBubble.kt | Adds helper for message bubble shapes. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/component/MessageActionsBottomSheet.kt | Adds message actions bottom sheet content + quick emoji row. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/component/MessageActions.kt | Adds reaction/reply/status action buttons. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/UnreadUiDefaults.kt | Centralizes unread-marker UI constants. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/QuickChat.kt | Removes hiltViewModel() default; requires explicit VM injection. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/MessageScreenEvent.kt | Introduces internal sealed event model for message screen actions. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/Message.kt | Removes hiltViewModel() default; requires explicit VM injection. |
| feature/messaging/src/androidMain/kotlin/org/meshtastic/feature/messaging/DeliveryInfoDialog.kt | Adds delivery info dialog composable. |
| feature/messaging/build.gradle.kts | Converts messaging feature into a KMP module + KSP setup. |
| feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/model/TracerouteOverlay.kt | Updates header; keeps traceroute overlay model in common. |
| feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/model/MapLayer.kt | Adds common map layer models (KML/GEOJSON). |
| feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/SharedMapViewModel.kt | Adds shared map ViewModel extending BaseMapViewModel. |
| feature/map/src/commonMain/kotlin/org/meshtastic/feature/map/BaseMapViewModel.kt | Makes BaseMapViewModel open and provides default getUser. |
| feature/map/src/androidUnitTestGoogle/kotlin/org/meshtastic/feature/map/MapViewModelTest.kt | Adds Google-flavor map ViewModel unit tests. |
| feature/map/src/androidUnitTestGoogle/kotlin/org/meshtastic/feature/map/MBTilesProviderTest.kt | Adds MBTiles provider unit test. |
| feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/MapScreen.kt | Uses LocalMapViewProvider and accepts injected shared VM. |
| feature/map/build.gradle.kts | Converts map feature into a KMP module + KSP setup. |
| feature/intro/src/commonMain/kotlin/org/meshtastic/feature/intro/IntroViewModel.kt | Removes Hilt annotations; makes ViewModel extensible for Android wrapper. |
| feature/intro/src/commonMain/kotlin/org/meshtastic/feature/intro/IntroNavKeys.kt | Moves intro navigation keys to commonMain. |
| feature/intro/src/androidUnitTest/kotlin/org/meshtastic/feature/intro/IntroViewModelTest.kt | Adds intro ViewModel unit tests. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/WelcomeScreen.kt | Injects analytics intro via LocalAnalyticsIntroProvider. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/PermissionScreenLayout.kt | Adds shared permission-screen layout for intro flow. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/NotificationsScreen.kt | Adds notifications permission intro screen. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/LocationScreen.kt | Adds location permission intro screen. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/IntroUiHelpers.kt | Updates header while keeping helper utilities. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/IntroNavGraph.kt | Removes inline NavKey objects (now in IntroNavKeys). |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/IntroBottomBar.kt | Updates header while keeping intro bottom bar. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/FeatureUIData.kt | Updates header while keeping feature UI model. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/CriticalAlertsScreen.kt | Adds critical alerts intro screen. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/BluetoothScreen.kt | Adds bluetooth permission intro screen. |
| feature/intro/src/androidMain/kotlin/org/meshtastic/feature/intro/AppIntroductionScreen.kt | Removes hiltViewModel() default; requires explicit VM injection. |
| feature/intro/build.gradle.kts | Converts intro feature into a KMP module + KSP setup. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/Esp32OtaUpdateHandlerTest.kt | Updates OTA handler test wiring for new BLE abstractions. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/BleOtaTransportTest.kt | Updates OTA transport tests to use scanner/connection factory. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/BleOtaTransportServiceDiscoveryTest.kt | Updates discovery tests to use scanner/connection factory. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/BleOtaTransportNordicMockTest.kt | Updates Nordic mock tests to use new BLE abstractions. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/BleOtaTransportMtuTest.kt | Updates MTU tests to use new BLE abstractions. |
| feature/firmware/src/test/kotlin/org/meshtastic/feature/firmware/ota/BleOtaTransportErrorTest.kt | Updates error tests to use new BLE abstractions. |
| feature/firmware/src/main/kotlin/org/meshtastic/feature/firmware/ota/Esp32OtaUpdateHandler.kt | Refactors OTA update handler to use scanner/connection factory. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/util/MapViewProvider.kt | Introduces map provider interface + LocalMapViewProvider. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/util/LocalNfcScannerProvider.kt | Adds NFC scanner provider CompositionLocal. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/util/LocalBarcodeScannerProvider.kt | Adds barcode scanner provider CompositionLocal. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/util/LocalAnalyticsIntroProvider.kt | Adds analytics intro provider CompositionLocal. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/util/BarcodeScanner.kt | Relocates BarcodeScanner interface into core UI util package. |
| core/ui/src/main/kotlin/org/meshtastic/core/ui/component/ImportFab.kt | Switches barcode/NFC scanning to provider-based injection. |
| core/ui/build.gradle.kts | Removes barcode/NFC module deps from core UI after decoupling. |
| core/service/src/androidMain/kotlin/org/meshtastic/core/service/testing/FakeIMeshService.kt | Adds fake AIDL service stub for tests/contract verification. |
| core/service/src/androidMain/kotlin/org/meshtastic/core/service/ServiceClient.kt | Adds generic AIDL service binding helper. |
| core/service/src/androidMain/kotlin/org/meshtastic/core/service/AndroidServiceRepository.kt | Adds Android implementation of ServiceRepository. |
| core/service/build.gradle.kts | Converts core service module to KMP + KSP setup. |
| core/data/src/commonMain/kotlin/org/meshtastic/core/data/manager/PacketHandlerImpl.kt | Removes a debug log line from packet queue job start. |
| core/ble/src/main/kotlin/org/meshtastic/core/ble/BleModule.kt | Removes previous Android-only Hilt BLE module (moved to app). |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/MeshtasticBleConstants.kt | Moves BLE UUID/name constants into commonMain. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BluetoothRepository.kt | Introduces common Bluetooth repository interface + state model. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleScanner.kt | Introduces common BLE scanning interface. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleRetry.kt | Adds common retry helper for BLE operations. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleDevice.kt | Introduces common BLE device abstraction. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleConnectionState.kt | Introduces common connection state model. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleConnectionFactory.kt | Introduces connection factory abstraction. |
| core/ble/src/commonMain/kotlin/org/meshtastic/core/ble/BleConnection.kt | Introduces common connection interface + write type. |
| core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBluetoothRepository.kt | Implements BluetoothRepository for Android using Nordic stack. |
| core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBleService.kt | Wraps Nordic RemoteService behind a common BleService type. |
| core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBleScanner.kt | Implements BleScanner via Nordic CentralManager. |
| core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBleDevice.kt | Wraps Nordic Peripheral behind BleDevice. |
| core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBleConnectionFactory.kt | Adds Android implementation of BleConnectionFactory. |
| core/ble/build.gradle.kts | Converts BLE module to KMP + KSP setup. |
| core/barcode/src/google/kotlin/org/meshtastic/core/barcode/BarcodeScannerProvider.kt | Updates imports to use relocated BarcodeScanner interface. |
| core/barcode/src/fdroid/kotlin/org/meshtastic/core/barcode/BarcodeScannerProvider.kt | Updates imports to use relocated BarcodeScanner interface. |
| core/barcode/build.gradle.kts | Adds dependency on core UI (for shared BarcodeScanner interface). |
| build-logic/gradle.properties | Updates Gradle JVM args + enables isolated projects. |
| app/src/test/kotlin/org/meshtastic/app/repository/radio/NordicBleInterfaceTest.kt | Updates tests for new BLE abstractions + wiring. |
| app/src/test/kotlin/org/meshtastic/app/repository/radio/NordicBleInterfaceRetryTest.kt | Updates retry tests for new BLE abstractions + wiring. |
| app/src/test/kotlin/org/meshtastic/app/messaging/domain/worker/SendMessageWorkerTest.kt | Fixes package to app module namespace. |
| app/src/main/kotlin/org/meshtastic/app/ui/connections/components/CurrentlyConnectedInfo.kt | Switches RSSI reads to BleDevice API and simplifies exception handling. |
| app/src/main/kotlin/org/meshtastic/app/ui/connections/components/BLEDevices.kt | Wraps scan results into AndroidBleDevice for UI/device selection. |
| app/src/main/kotlin/org/meshtastic/app/ui/connections/ScannerViewModel.kt | Updates bonding flow to use BleDevice/BluetoothRepository. |
| app/src/main/kotlin/org/meshtastic/app/service/AndroidMeshWorkerManager.kt | Updates worker import path to app namespace. |
| app/src/main/kotlin/org/meshtastic/app/repository/radio/NordicBleInterface.kt | Refactors BLE interface to use scanner/repo/factory abstractions. |
| app/src/main/kotlin/org/meshtastic/app/navigation/NodesNavigation.kt | Updates node map navigation to new app map packages. |
| app/src/main/kotlin/org/meshtastic/app/navigation/MapNavigation.kt | Injects Android shared map VM and passes to KMP MapScreen. |
| app/src/main/kotlin/org/meshtastic/app/navigation/ContactsNavigation.kt | Injects Android messaging VMs and passes explicitly into screens. |
| app/src/main/kotlin/org/meshtastic/app/model/DeviceListEntry.kt | Replaces Nordic Peripheral entry with BleDevice. |
| app/src/main/kotlin/org/meshtastic/app/messaging/domain/worker/WorkManagerMessageQueue.kt | Fixes package to app module namespace. |
| app/src/main/kotlin/org/meshtastic/app/messaging/domain/worker/SendMessageWorker.kt | Fixes package to app module namespace. |
| app/src/main/kotlin/org/meshtastic/app/messaging/di/MessagingModule.kt | Moves messaging DI bindings into app module namespace. |
| app/src/main/kotlin/org/meshtastic/app/messaging/AndroidQuickChatViewModel.kt | Adds Android Hilt wrapper around shared QuickChat VM. |
| app/src/main/kotlin/org/meshtastic/app/messaging/AndroidMessageViewModel.kt | Adds Android Hilt wrapper around shared Message VM. |
| app/src/main/kotlin/org/meshtastic/app/messaging/AndroidContactsViewModel.kt | Adds Android Hilt wrapper around shared Contacts VM. |
| app/src/main/kotlin/org/meshtastic/app/map/node/NodeMapViewModel.kt | Moves Node map VM into app namespace; exposes map style id. |
| app/src/main/kotlin/org/meshtastic/app/map/AndroidSharedMapViewModel.kt | Adds Android Hilt wrapper around shared map VM. |
| app/src/main/kotlin/org/meshtastic/app/intro/AndroidIntroViewModel.kt | Adds Android Hilt wrapper around shared intro VM. |
| app/src/main/kotlin/org/meshtastic/app/domain/usecase/GetDiscoveredDevicesUseCase.kt | Updates BLE short-name lookup to use BleDevice. |
| app/src/main/kotlin/org/meshtastic/app/di/ServiceModule.kt | Moves service DI module to app namespace. |
| app/src/main/kotlin/org/meshtastic/app/di/BleModule.kt | Adds app-level Hilt bindings for BLE abstractions and Nordic env. |
| app/src/main/kotlin/org/meshtastic/app/MainActivity.kt | Wires CompositionLocals for providers and intro ViewModel injection. |
| app/src/google/kotlin/org/meshtastic/app/map/repository/CustomTileProviderRepository.kt | Moves repository to app map namespace + updates imports. |
| app/src/google/kotlin/org/meshtastic/app/map/prefs/map/GoogleMapsPrefs.kt | Moves prefs to app map namespace + updates DI imports. |
| app/src/google/kotlin/org/meshtastic/app/map/prefs/di/GoogleMapsModule.kt | Moves DI module to app map namespace + updates bindings. |
| app/src/google/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt | Moves node map screen to app namespace + updates imports. |
| app/src/google/kotlin/org/meshtastic/app/map/model/NodeClusterItem.kt | Moves model to app map namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt | Moves model to app map namespace + updates headers. |
| app/src/google/kotlin/org/meshtastic/app/map/model/CustomTileProviderConfig.kt | Moves model to app map namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/component/WaypointMarkers.kt | Moves component to app map namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/component/PulsingNodeChip.kt | Moves component to app map namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/component/NodeClusterMarkers.kt | Moves component to app map namespace + updates imports. |
| app/src/google/kotlin/org/meshtastic/app/map/component/MapTypeDropdown.kt | Moves component to app map namespace + updates VM import. |
| app/src/google/kotlin/org/meshtastic/app/map/component/MapFilterDropdown.kt | Moves component to app map namespace + updates VM import. |
| app/src/google/kotlin/org/meshtastic/app/map/component/MapControlsOverlay.kt | Moves component to app map namespace + updates VM import. |
| app/src/google/kotlin/org/meshtastic/app/map/component/MapButton.kt | Moves component to app map namespace + updates headers. |
| app/src/google/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt | Updates time/date handling and moves to app map namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/component/CustomTileProviderManagerSheet.kt | Moves component to app map namespace + updates imports. |
| app/src/google/kotlin/org/meshtastic/app/map/component/CustomMapLayersSheet.kt | Moves component to app map namespace + updates MapLayer type import. |
| app/src/google/kotlin/org/meshtastic/app/map/component/ClusterItemsListDialog.kt | Moves component to app map namespace + updates imports. |
| app/src/google/kotlin/org/meshtastic/app/map/MapViewModel.kt | Moves Google map VM to app namespace; reuses shared base VM. |
| app/src/google/kotlin/org/meshtastic/app/map/MapView.kt | Moves Google map view implementation to app namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/MBTilesProvider.kt | Moves MBTiles provider to app namespace. |
| app/src/google/kotlin/org/meshtastic/app/map/LocationHandler.kt | Moves location handler to app namespace + updates headers. |
| app/src/google/kotlin/org/meshtastic/app/map/GoogleMapViewProvider.kt | Implements MapViewProvider for Google flavor. |
| app/src/google/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt | Returns Google flavor MapViewProvider. |
| app/src/google/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt | Moves analytics intro composable to app intro namespace. |
| app/src/google/AndroidManifest.xml | Adds Google flavor manifest for Maps API key meta-data. |
| app/src/fdroid/res/drawable/ic_map_navigation.xml | Adds F-Droid flavor map drawable. |
| app/src/fdroid/res/drawable/ic_map_location_dot.xml | Adds F-Droid flavor location drawable. |
| app/src/fdroid/res/drawable/ic_location_on.xml | Adds F-Droid flavor location drawable. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/node/NodeMapScreen.kt | Moves F-Droid node map screen to app namespace and adapts tile source. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/model/OnlineTileSourceAuth.kt | Moves model to app map namespace + updates headers. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/model/NOAAWmsTileSource.kt | Moves model to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/model/MarkerWithLabel.kt | Moves model to app map namespace + updates helper imports. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/model/CustomTileSource.kt | Moves model to app map namespace + updates headers. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/component/MapButton.kt | Moves component to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/component/EditWaypointDialog.kt | Moves component to app map namespace + updates date handling. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/component/DownloadButton.kt | Moves component to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/component/CacheLayout.kt | Moves component to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/SqlTileWriterExt.kt | Moves file to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewWithLifecycle.kt | Moves file to app map namespace + updates headers. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewModel.kt | Moves F-Droid map VM to app namespace; reuses shared base VM. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/MapViewExtensions.kt | Moves extensions to app map namespace + updates app R import. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/MapView.kt | Moves F-Droid map view implementation to app namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/MapUtils.kt | Moves utils to app map namespace. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/GetMapViewProvider.kt | Returns F-Droid flavor MapViewProvider. |
| app/src/fdroid/kotlin/org/meshtastic/app/map/FdroidMapViewProvider.kt | Implements MapViewProvider for F-Droid flavor. |
| app/src/fdroid/kotlin/org/meshtastic/app/intro/AnalyticsIntro.kt | Moves analytics intro composable to app intro namespace (F-Droid). |
| app/src/fdroid/java/org/meshtastic/app/map/cluster/StaticCluster.java | Moves clustering helper to app namespace. |
| app/src/fdroid/java/org/meshtastic/app/map/cluster/RadiusMarkerClusterer.java | Moves clustering helper to app namespace. |
| app/src/fdroid/java/org/meshtastic/app/map/cluster/MarkerClusterer.java | Moves clustering helper to app namespace. |
| app/build.gradle.kts | Adds required dependencies for new wiring (datetime, maps compose, etc.). |
| README.md | Updates architecture section to reflect KMP direction and providers. |
Comments suppressed due to low confidence (1)
core/ble/src/androidMain/kotlin/org/meshtastic/core/ble/AndroidBluetoothRepository.kt:68
bond(device: BleDevice)downcasts toAndroidBleDevice, which will crash for any otherBleDeviceimplementation (including mocks in unit tests). SinceBleDevicealready exposessuspend fun bond(), call that directly (or guard withas?and return a meaningful error).
You can also share your feedback on Copilot code review. Take the survey.
feature/node/src/main/kotlin/org/meshtastic/feature/node/metrics/TracerouteMapScreen.kt
Show resolved
Hide resolved
app/src/main/kotlin/org/meshtastic/app/repository/radio/NordicBleInterface.kt
Show resolved
Hide resolved
app/src/main/kotlin/org/meshtastic/app/repository/radio/NordicBleInterface.kt
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4738 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 231 231
Branches 34 34
=====================================
Misses 231 231 ☔ View full report in Codecov by Sentry. |
3485afd to
5e38b7b
Compare
This commit adds the `androidx.work.testing` library to the `testImplementation` configuration in the `app` module to enable unit testing for WorkManager tasks. Specific changes: - Added `libs.androidx.work.testing` to the dependencies section of `app/build.gradle.kts`. Signed-off-by: James Rich <[email protected]>
5e38b7b to
6ef5aca
Compare
This commit initiates a major architectural shift by migrating core modules and features toward Kotlin Multiplatform (KMP). Business logic, repositories, and ViewModels are being moved to
commonMainto decouple the application from the Android framework and facilitate future platform expansion.Key changes include:
Core BLE Refactoring:
BleDevice,BleScanner,BleConnection) incommonMain.androidMainand wrapped them behind the new interfaces.BleOtaTransportandNordicBleInterfaceto use the decoupled BLE abstractions.Feature Migration (Map, Messaging, Intro):
feature:map,feature:messaging, andfeature:introto KMP library modules.MessageViewModel,ContactsViewModel,BaseMapViewModel,IntroViewModel) tocommonMain.appmodule to maintain Dependency Injection compatibility.androidMain.UI & Resource Decoupling:
MapViewProviderand other provider interfaces to inject flavored UI components (Google Maps vs. osmdroid) into common code viaCompositionLocal.BarcodeScannerandAnalyticsIntroto a provider-based pattern.appmodule.Infrastructure & Maintenance:
AGENTS.mdandREADME.mdto reflect the new KMP vision and development guidelines.appmodule to resolve KSP generation issues in multi-flavor KMP modules.Specific changes:
commonMainvsandroidMainsource set structures.hiltViewModel()calls in library modules with explicit ViewModel parameters to support better testing and platform independence.MainActivityto provide flavored implementations throughCompositionLocalProvider.