Skip to content

build(compose): [AGP New DSL 1] Move sentry-compose to the KMP Android library plugin - #6642

Draft
runningcode wants to merge 1 commit into
no/agp-new-dslfrom
no/agp-new-dsl-compose
Draft

runningcode wants to merge 1 commit into
no/agp-new-dslfrom
no/agp-new-dsl-compose

Conversation

@runningcode

@runningcode runningcode commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (AGP New DSL)


📜 Description

Moves sentry-compose from org.jetbrains.kotlin.multiplatform + com.android.library to com.android.kotlin.multiplatform.library, the only KMP setup AGP allows once built-in Kotlin is on.

  • Android ABI check. KGP 2.3's ABI validation skips the new plugin's Android target. It wouldn't fail, it would just leave api/android stale and only check desktop. KmpAndroidAbiValidation.kt dumps that target with the same org.jetbrains.kotlin:abi-tools KGP uses, writes it to the same file, and hooks into checkKotlinAbi and updateKotlinAbi. The new dump is byte-identical to the old one, apart from BuildConfig.
  • BuildConfig is gone. The plugin doesn't support it, so VERSION_NAME now comes from a generated internal const. This removes the public io.sentry.compose.BuildConfig class, whose fields were AGP's generated defaults.
  • Conventions that keyed on com.android.library now handle the new plugin too: the Java 8 / JDK 21 test targets, minCompileSdk, verifyMethodParameters, the Robolectric jar prefetch and buildForCodeQL. Without this they would have skipped sentry-compose silently.
  • Lint only runs on this plugin with com.android.lint applied, which also lints the desktop target now.
  • Tests move to the plugin's androidHostTest source set, run by testAndroidHostTest. detekt's default test excludes predate that name, so detekt.yml adds it to the 15 rules that exclude test sources.

💡 Motivation and Context

First step toward dropping android.builtInKotlin=false and android.newDsl=false, which AGP 10 removes.

Part of JAVA-651 and #5782: built-in Kotlin rejects the old KMP + com.android.library setup.

💚 How did you test it?

  • :sentry-compose:check (tests, lint, detekt, ABI, method parameters) on AGP 9.5.1 and 9.0.0, the ends of the AGP matrix.
  • Compared the published sentry-compose, -android and -desktop artifacts with main. They have the same files, and the AAR's manifest, keep rules, R.txt, public.txt and AAR metadata are identical. The class list differs only in BuildConfig → SentryComposeVersionKt. The bytecode is still Java 8. The .module file renames the variants from release* to android* and adds the aar library-elements attribute. The POM and .module lose KGP's exclusions of the old kotlin-*-common artifacts.
  • :sentry-samples-android:assembleDebug, which depends on sentry-compose.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Built-in Kotlin and the new DSL land on 9.x.x in #6653, because built-in Kotlin needs the SDK to target Java 11.

🤖 Generated with Claude Code

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

#skip-changelog

KMP modules can't combine org.jetbrains.kotlin.multiplatform with
com.android.library once AGP's built-in Kotlin is on, which the new AGP
DSL needs. sentry-compose now uses com.android.kotlin.multiplatform.library.

The Kotlin Gradle plugin's ABI validation skips the new Android target,
so build-logic dumps it with the same abi-tools and hooks into
checkKotlinAbi and updateKotlinAbi. The JDK target, Robolectric and
CodeQL conventions learn the new plugin, lint needs com.android.lint,
and detekt's test excludes gain the androidHostTest source set.

The plugin has no BuildConfig, so the version comes from a generated
internal constant and io.sentry.compose.BuildConfig is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode runningcode mentioned this pull request Nov 17, 2026
3 of 9 tasks
@sentry

sentry Bot commented Nov 17, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.64.0 (1) release

⚙️ sentry-android Build Distribution Settings

@linear-code

linear-code Bot commented Nov 18, 2026

Copy link
Copy Markdown

JAVA-651

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant