Conversation
Introduces a maps-model multiplatform module with common LatLng and CameraPosition types (typealiased to the Play Services classes on Android, plain value holders on iOS) and converts the clustering module to Kotlin Multiplatform: the full algorithm layer (quadtree, geometry, projection, all clustering algorithms) now lives in commonMain and compiles for Android and iOS, while ClusterManager and the renderers remain Android-only in androidMain. JVM-only constructs in common code were replaced with multiplatform equivalents: an expect/actual PlatformLock replaces synchronized blocks and ReentrantReadWriteLock, java.util collections were swapped for Kotlin stdlib ones, and Math.* calls for kotlin.math. The three remaining Java test files were converted to Kotlin because KMP compilations do not compile Java host-test sources. Known gaps (prototype): publishing, jacoco, lint-checks and consumer proguard rules are not yet wired for the KMP module layout. Claude-Session: https://claude.ai/code/session_01225X6MnAqkyCF7Xones6WY
Apply maven-publish to maps-model and clustering so their multiplatform publications can be published to mavenLocal for consumption by the android-maps-compose KMP branch. Bump AGP 9.3.1 -> 9.4.0: AGP forbids mixing versions across composite builds, and android-maps-compose is already on 9.4.0. Claude-Session: https://claude.ai/code/session_01225X6MnAqkyCF7Xones6WY
Publishing the KMP clustering module as com.google.maps.android:clustering gave the same classes a second module identity next to the android-maps-utils-clustering AAR on Maven Central, producing duplicate class errors in apps that pull both (e.g. android-maps-compose's maps-app). Remap the publication artifactIds to the repo's public android-maps-utils-<module> scheme so both dependency paths conflict-resolve to a single module. Claude-Session: https://claude.ai/code/session_01225X6MnAqkyCF7Xones6WY
Converts the library module (PolyUtil, SphericalUtil, MathUtil in commonMain; StreetView utilities, collections managers and the attribution initializer in androidMain) and the heatmaps module (WeightedLatLng, Gradient and shared constants in commonMain; the Bitmap/Tile-based HeatmapTileProvider in androidMain) following the pattern established by the clustering migration. Gradient's android.graphics.Color usage is replaced by a common ColorUtils that reproduces the Android/Skia RGB<->HSV conversions exactly; GradientTest's hardcoded Android color values verify parity. The AttributionId codegen task is ported into the KMP build and wired into androidMain. Math.toRadians/toDegrees become common helpers. The Java test suites (PolyUtilTest, SphericalUtilTest, MathUtilTest, heatmaps UtilTest) are converted to Kotlin; the three math suites move to commonTest and now also run on iOS (36 tests green on the iOS simulator, 60 android host tests for library, 24 for heatmaps). robolectric.properties pins sdk=28 for host tests as Robolectric does not support targetSdk 37. Claude-Session: https://claude.ai/code/session_01225X6MnAqkyCF7Xones6WY
The KMP Android library plugin does not create lintDebug/SARIF reporting tasks, so :library:lintDebug no longer exists after the multiplatform migration. Lint data, ui and demo instead; KMP-module lint reporting is tracked as a known gap of the migration.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Contributor
Brings the experimental KMP work up to date with 6.0.0: the ktx migration, explicit API mode, binary compatibility validation, flexible polyline and the z-index work. - Files main added under the old src/main and src/test layout are moved into androidMain and androidHostTest. ClusterManagerFlows and Heatmap (Android-only) are moved out of commonMain, where git's directory rename detection had put them; PointExtensions stays common. - Conflicts resolved by keeping the multiplatform code and adding main's explicit public modifiers. maps-model gets explicit visibility, and HeatmapConstants becomes internal so it is not new public API. - New KmpPublishingConventionPlugin replaces the prototype maven-publish setup: explicit API, Kover (with a debug variant so koverXmlReportDebug and reportDebug.xml keep working), Dokka, lint via com.android.lint, and Vanniktech KotlinMultiplatform publishing under the existing android-maps-utils-* artifactIds. Shared POM and Maven Central setup moved to MapsUtilsPublishing.kt for both plugins. - The Android API of the KMP modules is checked against the existing api/<module>.api files and is unchanged. klib validation is enabled for the iOS ABI (api/<module>.klib.api). - Consumer keep rules and lint-checks are still published with the Android artifact.
The Kotlin Multiplatform modules publish iOS klibs, which can only be built on macOS, so publish.yml moves to macos-latest. Its sed calls use -i.bak, which works with both GNU and BSD sed. publish-snapshot.yml is a manual workflow that publishes a -SNAPSHOT version of every module to the Maven Central snapshot repository. It rejects versions that do not end with -SNAPSHOT and does not tag or commit anything.
The multiplatform library module gets lint tasks from com.android.lint, so lint-report goes back to linting library and demo, with :library:lint instead of :library:lintDebug.
README: which artifacts are multiplatform, what is shared and what stays Android-only, and the snapshot repository. AGENTS.md: maps-model, the source set layout, API files and the macOS requirement for iOS targets.
This was referenced Oct 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Experimental Kotlin Multiplatform support for android-maps-utils, so the platform-independent utilities can be used from common code and from the KMP module of android-maps-compose (googlemaps/android-maps-compose#927). Now up to date with 6.0.0.
maps-modelmodule: commonLatLng/CameraPosition. On Android they areactual typealiases to the Play Services classes, so the Android API is unchanged. On iOS they are value holders replicating the GMS clamping, wrapping and equality semantics.clustering: the algorithm layer (quadtree, geometry, Mercator projection, all algorithms) is incommonMainand compiles for Android,iosArm64,iosSimulatorArm64andiosX64.ClusterManager, the renderers and the ktx flows stay Android-only.library:PolyUtil,SphericalUtil,MathUtilincommonMain. The Maps SDK extensions (ktx), Street View, collections and the attribution initializer stay inandroidMain.heatmaps:WeightedLatLng,Gradientand a commonColorUtils(matching Android's HSV conversion) incommonMain;HeatmapTileProviderstays Android-only.PlatformLock(ReentrantLock / NSRecursiveLock),kotlin.math, stdlib collections.Merge with 6.0.0
Merged
main(ktx migration, explicit API, binary compatibility validation, flexible polyline, z-index). Files main added in the oldsrc/main/src/testlayout were moved intoandroidMain/androidHostTest, and Android-only files git had placed incommonMainwere moved out.Publishing and tooling (previously the known gaps)
KmpPublishingConventionPlugin: explicit API, Dokka, Kover, lint and VanniktechKotlinMultiplatformpublishing under the existingandroid-maps-utils-*artifactIds and POM (shared withPublishingConventionPluginviaMapsUtilsPublishing.kt).api/<module>.apifiles and is byte-for-byte unchanged. klib validation is enabled for the iOS ABI (api/<module>.klib.api).lint.jar(lint-checks), the consumer keep rules and the attribution startup provider.debugvariant, sokoverXmlReportDebugandreportDebug.xmlkeep feeding the coverage history. Numbers match main (library 87.3%, clustering 33.2%, heatmaps 81.8%).com.android.lintgives the KMP modules lint tasks;lint-reportlintslibraryagain.publish.ymlnow runs onmacos-latest(iOS klibs can only be built on macOS). New manualpublish-snapshot.ymlpublishes a-SNAPSHOTversion to the Maven Central snapshot repository.Remaining limitations
PreCachingAlgorithmDecoratorstays Android-only (Executors-based; candidate for a coroutines rewrite).NonHierarchicalDistanceBasedAlgorithmthat did their ownsynchronized(mQuadTree)no longer synchronize with the internal lock.data(GeoJSON/KML) anduistay Android-only by design.clusteringandheatmapshave nocommonTestyet, so nothing of theirs runs on iOS.com.google.maps.androidnamespace in the Central Portal.Test plan
Locally on macOS:
./gradlew build apiCheck koverXmlReportDebug(whattest.ymlruns) passes, including iOS compilation and tests.:library:iosSimulatorArm64Test: 36 shared geometry tests green on the iOS simulator.:data,:ui,:maps-utilsand:demo(app and test APK) build against the KMP modules.publishToMavenLocal(scratch repo) produces the root,-androidand three iOS artifacts per module, with sources and javadoc jars. A6.1.0-SNAPSHOTbuild also publishes.