Convert core module to Kotlin Mutliplatform#133
Conversation
This reverts commit 31a11dc.
|
How we want to continue here? From my side all things are done, and we now published a pre-release ( Do we want keep this open, and also wait until the GeoJSON library (maplibre-java) is ready. And afterwards also the MapLibre native? Or do we want merging this now, and keeping on pre-releases (or not?) until all the other stuff is done? I would personally prefer the latter. Then we can continue development, without having this too big PR open. |
|
In my opinion we should merge this sooner rather than later (same for the maplibre-java). It will just get messy. The current state seems to work reasonably fine already and if we find a bug, we can create a new PR? The PR IMHO is probably too big for most people to review anyway, so we just scare people off with this 😄. |
boldtrn
left a comment
There was a problem hiding this comment.
From my side, I would be fine with merging this. It's a huge change but so far all testing looks good.
This PR is migrating the core module to Kotlin Multiplatform.
Breaking changes
android.location.Locationwe have now our own genericorg.maplibre.navigation.core.location.Location.libandroid-navigationrenamed tomaplibre-navigation-core(important for Jitpack reference)org.maplibre.navigation.android.navigation.v5.has renamed toorg.maplibre.navigation.coreMapLibreNavigation, but there it's now required to set aLocationEngine. Alternative usingAndroidMapLibreNavigation/IOSMapLibreNavigationfor a default implementation of this parameter.Some key facts
contextand other Android platform related classes.NavigationService,Notificationand Android specific threading. I don't see a reason to keep this, I switched the threading to coroutines, and the notification and foregrounds service are now optional components, that included in the UI module. The navigation core logic is now located innavigation.enginepackage. The notification is now located in the UI module innavigationpackageandroid, I renamed the module tomaplibre-navigation-coreandroid, I renamed the package fromorg.maplibre.navigation.android.navigation.v5.toorg.maplibre.navigation.corePlatform specific logic
Two categories of platform specific parts are affected this module.
**1. the location logic.*+ I'm very happy with the solution around the
LocationEngineand the platform specific logic.2. the MapLibre library / GeoJson / Turf logic. I'm very unhappy with the geojson stuff. I now added a new module
maplibre-navigation-geothat holds some partial (simplified) copies of thegeojsonandturfstuff. The original repository maplibre-java are used before by the Android client. But Java code can not included to iOS with KMP.I see three solutions for this:
All of this points having up- and downsides. I choosed now the 3. point, because it was the fastest. I would suggest to create a follow up issue and discuss this here.
To find a solution, we need also input from the maintainers of
maplibre-javaand needing also a look to the iOS side, and how we implement this core module.Performance
I changed a the whole logic structure, that was necessary to remove all Android related things, and using plain Kotlin. I tried my best to keep it simple and efficient. But I think we all should do some performance tests with real navigations and real-life example usages.