Skip to content

test: add Java and Kotlin consumer fixtures built against the published artifacts - #848

Open
nickolas-dimitrakas wants to merge 1 commit into
ci/binary-compat-reportfrom
test/consumer-compat-fixtures
Open

nickolas-dimitrakas wants to merge 1 commit into
ci/binary-compat-reportfrom
test/consumer-compat-fixtures

Conversation

@nickolas-dimitrakas

Copy link
Copy Markdown
Contributor

Summary

Adds two small, unpublished com.android.library modules under compat/ that compile against the published com.mparticle:android-core (R8-minified) and com.mparticle:android-kit-base artifacts the way an integrating app and a third-party kit do: java-consumer from Java and kotlin-consumer from Kotlin with allWarningsAsErrors. Each exercises the documented API and a KitIntegration subclass that implements every listener interface. Nothing runs; the modules exist to fail to compile when the shipped API changes in a way the module build cannot see.

  • settings-compat.gradle keeps the modules out of the main build, like the kits.
  • Both modules resolve com.mparticle only from mavenLocal() at the version under review, mirroring KitPlugin.configureRepositories, so the previous Maven Central release can never be picked up by mistake.
  • CI: one new step in the Kit Compatibility Test job runs ./gradlew -c settings-compat.gradle assembleDebug after the kit release tests, where core has already been published to Maven Local.
  • compat/README.md explains the purpose and how to run the fixtures locally.

Finding

Compiling the Kotlin fixture against the published 6.1.2 AAR fails on CoreCallbacks.KitListener.Companion and .EMPTY with Unresolved reference 'Companion'. R8 renames the companion object to KitListener$b while the retained kotlin.Metadata still names Companion, so Kotlin consumers cannot resolve it (Java consumers can, since EMPTY survives as a static field on the interface). The probe was removed from the fixture so the module builds; the fix is a ProGuard-rules change and will come as its own pull request.

Verification

  • ./gradlew publishMavenPublicationToMavenLocal -PVERSION=6.1.2, then ./gradlew -c settings-compat.gradle assembleDebug -PVERSION=6.1.2: passes with no warnings.
  • ./gradlew -c settings-compat.gradle ktlintCheck: passes.
  • Negative test pinned to 6.1.1 (on Maven Central, not in ~/.m2) fails resolution, confirming Central is excluded for com.mparticle.

Follow-ups

  • Add ./gradlew -c settings-compat.gradle ktlintCheck to the Kotlin Lint Checks job so fixture formatting is enforced in CI.
  • Derive the fixtures' JVM target from JAVA_VERSION in gradle.properties rather than a literal.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

📦 SDK Size Impact Report

What the SDK adds to a minified release APK.

Measured against an empty baseline app. Unlike the Rokt kit, android-core ships no Compose and no resources, so there is nothing here that a host app would already provide.

mParticle Core SDK

Metric Target branch This PR Change
APK size 119.79 KB 119.78 KB -6 bytes
Download size 117.60 KB 117.60 KB -2 bytes
Dex bytes 213.75 KB 213.75 KB 0 bytes

➡️ SDK size impact change is minimal.

Raw measurements

Target branch:

{"baseline_dex_bytes": 0, "baseline_download_bytes": 2512, "baseline_install_bytes": 7528, "core_dex_bytes": 218884, "core_download_bytes": 122936, "core_install_bytes": 130189}

This PR:

{"baseline_dex_bytes": 0, "baseline_download_bytes": 2511, "baseline_install_bytes": 7528, "core_dex_bytes": 218884, "core_download_bytes": 122933, "core_install_bytes": 130183}

Measured 6486216 merged into b620b9b

@nickolas-dimitrakas
nickolas-dimitrakas force-pushed the test/consumer-compat-fixtures branch from c36984d to b7711a1 Compare September 24, 2026 04:48
@nickolas-dimitrakas
nickolas-dimitrakas changed the base branch from main to ci/binary-compat-report September 24, 2026 04:48
@github-actions

Copy link
Copy Markdown

📦 SDK Size Impact Report

What the SDK adds to a minified release APK.

Measured against a Compose + Material3 reference app, so these are the costs on top of an app that already ships Compose. The reference app's dependencies are a documented convention, not a measured average: see size-report-rokt/README.md.

mParticle Core + Rokt kit

Metric Target branch This PR Change
APK size 1.31 MB 1.31 MB 0 bytes
Download size 1.29 MB 1.29 MB +1 bytes
Dex bytes 2.33 MB 2.33 MB 0 bytes

Rokt SDK+ umbrella (adds the payment extension)

Metric Target branch This PR Change On top of mParticle Core + Rokt kit
APK size 6.55 MB 6.55 MB 0 bytes +5.24 MB
Download size 6.44 MB 6.44 MB +2 bytes +5.14 MB
Dex bytes 7.13 MB 7.13 MB 0 bytes +4.80 MB

➡️ SDK size impact change is minimal.

Raw measurements

Target branch:

{"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4274892, "kit_download_bytes": 2596898, "kit_install_bytes": 2674686, "sdkplus_dex_bytes": 9305380, "sdkplus_download_bytes": 7989542, "sdkplus_install_bytes": 8165359}

This PR:

{"baseline_dex_bytes": 1829108, "baseline_download_bytes": 1240062, "baseline_install_bytes": 1300934, "kit_dex_bytes": 4274892, "kit_download_bytes": 2596899, "kit_install_bytes": 2674686, "sdkplus_dex_bytes": 9305380, "sdkplus_download_bytes": 7989544, "sdkplus_install_bytes": 8165359}

Measured b7711a1 merged into 4ee3ba4

@nickolas-dimitrakas
nickolas-dimitrakas added this pull request to stack #851 September 24, 2026 05:47
@nickolas-dimitrakas nickolas-dimitrakas self-assigned this Sep 24, 2026
@nickolas-dimitrakas
nickolas-dimitrakas marked this pull request as ready for review October 6, 2026 18:21
@nickolas-dimitrakas
nickolas-dimitrakas requested a review from a team as a code owner October 6, 2026 18:21
@cursor

cursor Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Test fixture and CI build configuration changes only; no runtime SDK code is modified.

Overview
Adds compile-only consumer fixture modules (compat/java-consumer and compat/kotlin-consumer) in a standalone settings-compat.gradle to verify the public API and kit interfaces against published release artifacts.

Both fixtures resolve com.mparticle dependencies exclusively from mavenLocal() at the target build version. The Kotlin fixture enforces allWarningsAsErrors to catch deprecations, nullability discrepancies, or R8 obfuscation issues that could break downstream consumers.

Integrates a new fixture build step into the CI pull-request.yml workflow under the Kit Compatibility Test job.

Reviewed by Cursor Bugbot for commit 6486216. Bugbot is set up for automated code reviews on this repo. Configure here.

@nickolas-dimitrakas
nickolas-dimitrakas force-pushed the test/consumer-compat-fixtures branch 3 times, most recently from 7eb34ef to ca72427 Compare October 6, 2026 21:04
@nickolas-dimitrakas
nickolas-dimitrakas force-pushed the test/consumer-compat-fixtures branch 2 times, most recently from 42a659c to 68ca013 Compare October 6, 2026 21:45
…ed artifacts

Add compat/java-consumer and compat/kotlin-consumer, two unpublished library modules that compile the documented API and a full KitIntegration listener set against the com.mparticle:android-core and android-kit-base artifacts in mavenLocal, resolved only from there so the version under review is the one exercised. The module build in settings.gradle compiles against source and cannot see what R8 or retained Kotlin metadata does to the published surface; these fixtures fail instead. The Kit Compatibility Test job builds them right after publishing core to mavenLocal.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@nickolas-dimitrakas
nickolas-dimitrakas force-pushed the test/consumer-compat-fixtures branch from 68ca013 to 6486216 Compare October 6, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant