Repository navigation
build: check the public API of the library modules - #1067
Merged
Merged
Conversation
Add the binary compatibility validator, set up the same way as in android-maps-utils: apiBuild, apiDump and apiCheck per library module, reading the release classes jar. Commit the current API of maps-compose, maps-compose-utils and maps-compose-widgets in api/<module>.api and run apiCheck in CI, so a public API change shows up in review and an accidental break fails the build.
Coverage (unit tests)Compared against
Line and branch coverage from unit test reports. History is recorded on the |
Contributor
Coverage (instrumentation tests)
|
dkhawk
approved these changes
Nov 3, 2026
This was referenced Nov 3, 2026
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
maps-compose has no check on its public API today. AGENTS.md says public API changes must be additive and backward compatible, but nothing enforces it, so an accidental break (a removed overload, a changed parameter type, a default that moved) would only be found by users after a release. android-maps-utils already guards this with the binary compatibility validator; this PR sets up the same thing here.
org.jetbrains.kotlinx.binary-compatibility-validator0.18.2, same version as android-maps-utils.PublishingConventionPluginregistersapiBuild,apiDumpandapiCheckfor each library module, reading the releaseclasses.jar, exactly like android-maps-utils does (the plugin's own Android integration does not fit AGP 9 built-in Kotlin).checkdepends onapiCheck, and there are rootapiDump/apiChecktasks for all modules.maps-compose/api/maps-compose.api(319 lines),maps-compose-utils/api/maps-compose-utils.api(51) andmaps-compose-widgets/api/maps-compose-widgets.api(6). The generatedRclasses and their nested classes are ignored, since they are public in bytecode but not part of the API.apiCheckin thetestworkflow.apiDump.A few points worth to mention
.apifiles are also a nice snapshot of what we expose today. It is worth a quick look: some things are public only for technical reasons (i.e.ComposableSingletons$GoogleMapKt, generated by the Compose compiler).Testing
./gradlew apiDumpgenerates the three files, and./gradlew apiCheckpasses on them.ScaleBarmakes:maps-compose-widgets:apiCheckfail with the old and new signatures; reverting it passes again../gradlew build apiCheck(same as the updated CI command) andspotlessKotlinCheckpass locally.