Skip to content

build(samples): [Sample Tests 44] Prepare the samples to build outside the SDK build - #6391

Merged
runningcode merged 21 commits into
mainfrom
no/samples-build-groundwork
Nov 6, 2026
Merged

runningcode merged 21 commits into
mainfrom
no/samples-build-groundwork

Conversation

@runningcode

@runningcode runningcode commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

The next three PRs move the samples and the Android integration tests into their own Gradle builds. This one removes what ties them to the SDK build's buildSrc and root build script first, while they are still subprojects. No task changes behavior.

  • Config.*: the sample and uitest build files name the coordinates directly, the way a customer's build would.
  • MergeSpringMetadataAction: only five samples' shadowJar tasks use it. It moves from buildSrc to build-logic, which the new builds can include.
  • KotlinCompilerVersion: a compiler-internal class that only resolved through buildSrc's (or AGP's) classpath. In a JVM-only build, KGP's bundled copy is deprecated at ERROR level. The build files now use KGP's getKotlinPluginVersion(), which returns the same version.
  • AGP: it came from Config.AGP on the root buildscript classpath. It now comes from the catalog's agp version through an android-application plugin alias, and the root settings applies the AGP matrix job's VERSION_AGP override. Each new build's settings will apply it too, because a composite build only allows one AGP version.
  • javac -Xlint:all -Werror: these flags move from the root allprojects block to the io.sentry.jdk-target convention, which every subproject already applies and the new builds can apply too.

💡 Motivation and Context

Part of the Linear project "Separate sample projects and tests from build." (JAVA-626). The goal is to untie the SDK build from the versions used to test. We start with composite builds that include the SDK build. The SDK build doesn't include them back, so their plugins and versions stay out of it.

AGP is the exception, because a composite build can only use one AGP version. With an app on AGP 9.2.1 including a library build on AGP 9.4.0, AGP fails with Using multiple versions of the Android Gradle plugin(9.4.0, 9.2.1) in the same build is not allowed. Decoupling AGP needs the build-local Maven repo from JAVA-625, as a later step.

💚 How did you test it?

  • buildEnvironment: AGP resolves to 9.4.0 by default and to 9.2.1 with VERSION_AGP=9.2.1.
  • All 23 changed sample and uitest projects compile.
  • shadowJar of sentry-samples-spring-boot and sentry-samples-netflix-dgs runs, with MergeSpringMetadataAction loaded from build-logic.
  • kotlin-stdlib-jdk8 still resolves to 2.3.21.
  • With a raw type temporarily added to sentry-jul, compileJava fails with warnings found and -Werror specified.

📝 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

#6392 moves the Android sample to its 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.63.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/spring-boot-oldest-compile-check branch from d2dac4e to 25c20ff Compare October 27, 2026 14:33
@runningcode runningcode changed the title build(samples): [Sample Tests 44] Prepare the samples to build outside the SDK build build(samples): [Sample Tests 45] Prepare the samples to build outside the SDK build Oct 27, 2026
@runningcode
runningcode force-pushed the no/spring-boot-oldest-compile-check branch from 25c20ff to 8eb9829 Compare October 27, 2026 15:08
@runningcode
runningcode force-pushed the no/samples-build-groundwork branch 3 times, most recently from 1bd946c to fa34787 Compare October 28, 2026 10:38
@runningcode
runningcode changed the base branch from no/spring-boot-oldest-compile-check to no/spring-boot-matrix-tasks October 28, 2026 10:38
@runningcode runningcode changed the title build(samples): [Sample Tests 45] Prepare the samples to build outside the SDK build build(samples): [Sample Tests 44] Prepare the samples to build outside the SDK build Oct 28, 2026
@runningcode
runningcode marked this pull request as ready for review October 28, 2026 11:09
@runningcode
runningcode requested review from a team and adinauer as code owners October 28, 2026 11:09
Base automatically changed from no/spring-boot-matrix-tasks to no/drop-boot-2.4-2.6 October 28, 2026 14:50
Base automatically changed from no/drop-boot-2.4-2.6 to main October 28, 2026 15:05
@runningcode
runningcode force-pushed the no/samples-build-groundwork branch from fa34787 to e796595 Compare October 28, 2026 16:32
Comment thread settings.gradle.kts Resolved
Comment thread gradle/libs.versions.toml Resolved
The samples and Android integration tests are about to become their own
builds, which include the SDK build. Several things tie them to the SDK
build today:

- They call buildSrc's Config, which other builds cannot see. They now
  name the coordinates directly, the way a customer's build would.
- Five samples' shadowJar tasks use buildSrc's MergeSpringMetadataAction,
  which only the samples use. It moves to build-logic, which the new
  builds can include.
- They pick the Kotlin stdlib version with KotlinCompilerVersion, a
  compiler-internal class that came from buildSrc's classpath. They now
  use KGP's getKotlinPluginVersion(), which returns the same version.
- AGP came from Config.AGP on the root buildscript classpath. A composite
  build must use a single AGP version, so it now comes from the version
  catalog, and each build's settings applies the AGP matrix job's
  VERSION_AGP override.
- The javac -Xlint:all -Werror flags came from the root allprojects
  block. They move to the io.sentry.jdk-target convention, which every
  subproject already applies and the new builds can apply too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
romtsn and others added 20 commits November 6, 2026 15:30
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>
Instead of adding it to `make preMerge`, which the SDK's Build job runs,
a new Samples workflow runs the Android sample build's `check` as its own
job. A broken sample then fails its own check, it runs in parallel with
the SDK build, and the Build job doesn't get longer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he Samples workflow

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…les workflow

The head-SHA ref only matters for build.yml's snapshot upload, and the
repository has had no submodules since #3189.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ld's

gradle.properties, gradlew, gradle/wrapper and
gradle/gradle-daemon-jvm.properties are now symlinks to the SDK build's
files. Both builds pick the same daemon JDK and JVM arguments, so they
can share a daemon, and the sample reads the SDK version from the
versionName property instead of parsing the root file.

The copied gradle.properties had drifted from the root one (-Xmx6g and
CrashOnOutOfMemoryError instead of -Xmx8g and HeapDumpOnOutOfMemoryError).

Dependabot also scans the sample build, so the Develocity plugins in its
settings stay current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The samples and integration test builds have no unit tests, and
phoenix-actions/test-reporting fails the job when it finds no JUnit XML,
even with fail-on-error set to false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The root spotlessApply can't reach the Android sample, because the SDK
build doesn't include it. make format runs spotlessApply in the root and
in the sample build, and the format workflow, AGENTS.md, CONTRIBUTING.md
and the create-java-pr skill use it. CONTRIBUTING.md already documented
make format, which #4476 removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sample's settings now add versionName to the catalog as
libs.versions.sentry, as the other separate builds do, and use the root
build's Develocity plugin version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sentry-uitest-android, sentry-uitest-android-critical and test-app-size
are now a standalone Gradle build that includes the SDK build, like the
Android sample. They depend on io.sentry:* coordinates, which Gradle
substitutes with the SDK's projects, including the unpublished
sentry-test-support. The SDK build doesn't include them back, so SAGP,
errorprone's uitest checks and their AndroidX test dependencies no longer
load in the SDK build.

AGP stays shared: a composite build can only use one AGP version, so the
AGP matrix job's VERSION_AGP still applies to both builds.

Root check and spotlessApply no longer reach these apps, so preMerge runs
this build's check, which covers what the root check ran for them: lint,
detekt and spotless. The format workflow runs its spotlessApply, and the
AGP matrix, UI test and size workflows call it with -p. APK paths don't
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…workflow

Adds the integration tests build to the Samples workflow's matrix instead
of a `make preMerge` target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Android sample and integration tests in their own builds, no
project in the SDK build applies the Sentry Android Gradle Plugin. The
root no longer declares it or looks it up in mavenLocal when useSagp is
set; those builds declare it and handle useSagp themselves.

The root keeps the AGP declaration: the SDK's Android modules apply
com.android.library without a version and get AGP from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uild's

gradle.properties, gradlew, gradle/wrapper and
gradle/gradle-daemon-jvm.properties are now symlinks to the SDK build's
files, as in the Android sample. The copied gradle.properties had drifted
from the root one (-Xmx6g and CrashOnOutOfMemoryError), and the build had
no wrapper or daemon JDK pin. The SDK version now comes from the shared
versionName property instead of parsing the root file.

The root drops android.experimental.lint.version. It equals the lint
bundled with AGP 9.4.0, so it changes nothing for the SDK build, and
sentry-uitest-android's warningsAsErrors fails on it once the integration
tests share the root gradle.properties.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adding or removing a project then changes only its own line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… versions current

The integration tests' settings use the root build's Develocity plugin
version, and Dependabot also scans their build, as it does the Android
sample's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ettings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/samples-build-groundwork branch from 8d0ed83 to 0825f70 Compare November 6, 2026 14:34
@runningcode
runningcode merged commit 14c2936 into main Nov 6, 2026
45 checks passed
@runningcode
runningcode deleted the no/samples-build-groundwork branch November 6, 2026 14:47
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.

2 participants