Skip to content

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

Draft
runningcode wants to merge 1 commit into
no/spring-boot-oldest-compile-checkfrom
no/samples-build-groundwork
Draft

runningcode wants to merge 1 commit into
no/spring-boot-oldest-compile-checkfrom
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.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/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
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>
@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 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