Skip to content

build(samples): [Sample Tests 46] Move the Android sample to its own build - #6392

Draft
runningcode wants to merge 1 commit into
no/samples-build-groundworkfrom
no/android-sample-own-build
Draft

runningcode wants to merge 1 commit into
no/samples-build-groundworkfrom
no/android-sample-own-build

Conversation

@runningcode

@runningcode runningcode commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

sentry-samples/sentry-samples-android is now a standalone Gradle build that includes the SDK build. It depends on io.sentry:* coordinates, which Gradle substitutes with the SDK's projects, so there is nothing to publish first. The SDK build doesn't include the sample back, so KSP, SQLDelight, Room and CameraX no longer load in it.

Run it with ./gradlew -p sentry-samples/sentry-samples-android <task>, or open that directory in Android Studio.

  • Macrobenchmark: it moves into the sample's build as :macrobenchmark, because AGP requires a benchmark and the app it targets to be in the same build. The macrobenchmark workflow and its Sauce config follow.
  • SDK version: Gradle reads gradle.properties only for the build it belongs to. The sample's settings read versionName from the SDK build's file and add it to the catalog as libs.versions.sentry.
  • gradle.properties: the sample has its own copy of the lines it needs from the root file. It leaves out android.experimental.lint.version, because lint reads the build root's gradle.properties and flags the pin, which equals AGP's bundled lint (9.4.0).
  • CI: root check and spotlessApply no longer reach the sample. make preMerge, which the required Build job runs, runs the sample build's check. That covers what the root check ran for it: lint, unit tests, the SQLDelight migration checks and spotless. The format workflow and make checkFormat cover the sample build too.

💡 Motivation and Context

Part of the Linear project "Separate sample projects and tests from build." (JAVA-626): untie the SDK build from the versions used to test. This takes over from #6047, without that PR's include from the root build back into the sample. Including it back would put the sample's plugins and versions into the SDK build again.

💚 How did you test it?

  • assembleDebug, assembleRelease and :macrobenchmark:assembleBenchmark succeed. The APKs land at the paths the Sauce config uses.
  • dependencies --configuration debugRuntimeClasspath: all 11 io.sentry:* dependencies resolve to SDK projects.
  • check passes and runs lintDebug, testDebugUnitTest, both SQLDelight migration checks and spotless.
  • The sample's Java compiles with the -Xlint:all -Werror flags from io.sentry.jdk-target.
  • Root check --dry-run no longer includes the sample.

📝 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

The sample directory has no Gradle wrapper of its own, so opening it alone in Android Studio may ask which Gradle to use.

#6393 moves the Android integration tests to their own build.

#skip-changelog

🤖 Generated with Claude Code

@sentry

sentry Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode force-pushed the no/samples-build-groundwork branch from 5ef89c4 to c18fe91 Compare October 27, 2026 14:33
@runningcode
runningcode force-pushed the no/android-sample-own-build branch from f28da1f to 63b12f6 Compare October 27, 2026 14:33
@runningcode runningcode changed the title build(samples): [Sample Tests 45] Move the Android sample to its own build build(samples): [Sample Tests 46] Move the Android sample to its own build Oct 27, 2026
The Android sample is now a standalone Gradle build that includes the SDK
build. It depends on io.sentry:* coordinates, which Gradle substitutes with
the SDK's projects, so there is nothing to publish first. The SDK build
doesn't include it back, so the sample's plugins (KSP, SQLDelight, Room,
CameraX) no longer load in the SDK build.

The macrobenchmark moves into the sample's build, because AGP requires a
benchmark and the app it targets to be in the same build.

Root check and spotlessApply no longer reach the sample, so preMerge runs
the sample build's check, and the format workflow runs its spotlessApply.
That check covers what the root check ran for it: lint, unit tests,
SQLDelight migrations and spotless.

Run it with ./gradlew -p sentry-samples/sentry-samples-android <task>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/android-sample-own-build branch from 63b12f6 to e4a9b5a Compare October 27, 2026 15:08
@runningcode
runningcode force-pushed the no/samples-build-groundwork branch from c18fe91 to 95d364c Compare October 27, 2026 15:08

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant