Skip to content

build(samples): Build the Android sample and tests in one Gradle build - #6613

Merged
runningcode merged 1 commit into
mainfrom
no/android-single-composite-build
Nov 17, 2026
Merged

runningcode merged 1 commit into
mainfrom
no/android-single-composite-build

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

Merges the two Android Gradle builds that sit outside the SDK build into one. The Android sample and its macrobenchmark move into sentry-android-integration-tests, next to the UI tests and the size test, so every Android app that exercises the SDK lives in one folder and one build.

Builds

Before, there were two Android builds, each including the SDK build:

flowchart LR
  SDK[("SDK build<br/>(repo root)")]

  subgraph SA["sentry-samples/sentry-samples-android (build)"]
    APP[": (root project)<br/>sample app"]
    MB[":macrobenchmark"]
  end

  subgraph IT["sentry-android-integration-tests (build)"]
    UI[":sentry-uitest-android"]
    CR[":sentry-uitest-android-critical"]
    SZ[":test-app-size"]
  end

  MB -- targetProjectPath --> APP
  SA -. includeBuild .-> SDK
  IT -. includeBuild .-> SDK
Loading

After, there is one:

flowchart LR
  SDK[("SDK build<br/>(repo root)")]

  subgraph IT["sentry-android-integration-tests (build)"]
    APP[":sentry-samples-android"]
    MB[":sentry-uitest-android-macrobenchmark"]
    UI[":sentry-uitest-android"]
    CR[":sentry-uitest-android-critical"]
    SZ[":test-app-size"]
  end

  MB -- targetProjectPath --> APP
  IT -. includeBuild .-> SDK
Loading

Folders

Before:

sentry-samples/                          JVM samples build
└── sentry-samples-android/              Android sample build, nested
    ├── settings.gradle.kts
    ├── src/                             sample app (root project)
    └── macrobenchmark/
sentry-android-integration-tests/        Android tests build
├── settings.gradle.kts
├── sentry-uitest-android/
├── sentry-uitest-android-critical/
└── test-app-size/

After:

sentry-samples/                          JVM samples build only
sentry-android-integration-tests/        the one Android build
├── settings.gradle.kts
├── sentry-samples-android/              ← moved from sentry-samples/
├── sentry-uitest-android-macrobenchmark/ ← moved from the sample, renamed
├── sentry-uitest-android/
├── sentry-uitest-android-critical/
└── test-app-size/

Changes

  • The sample is now a subproject instead of its build's root project. Its settings.gradle.kts and the symlinked gradle.properties, gradlew, gradle/wrapper and gradle/gradle-daemon-jvm.properties are gone, since the integration-tests build already has identical ones. It stays two levels below the repo root, so its relative paths (debug.keystore, the native logging toggle) are unchanged.
  • The macrobenchmark is called sentry-uitest-android-macrobenchmark again, its name before build(samples): [Sample Tests 44] Prepare the samples to build outside the SDK build #6391 moved it into the sample's build. That also matches its namespace and its Sauce config. targetProjectPath points at :sentry-samples-android.
  • The build root declares the sample's KSP and SQLDelight plugins with apply false, like the other plugins, so they load next to AGP and KGP.
  • CI and tooling:
    • The Samples workflow drops its sentry-samples-android row; the sentry-android-integration-tests row now checks the sample too.
    • The macrobenchmark workflow and .sauce/sentry-uitest-android-macrobenchmark.yml use the new task and APK paths.
    • The Spring Boot matrices drop their sentry-samples/sentry-samples-android/** ignore, since *android*/** already covers the new location.
    • make format and make checkFormat run three builds instead of four.
  • READMEs, AGENTS.md and the btrace skill use the new paths. In Android Studio, open sentry-android-integration-tests to get the sample.

💡 Motivation and Context

Two Android builds meant two Gradle configurations, two Samples CI jobs, and the sample's build nested inside the JVM samples folder. The macrobenchmark only had to move into the sample's build because targetProjectPath must name a project in the same build; with a single build it can sit next to the other test apps again.

💚 How did you test it?

Assembled the sample (debug and release) and the macrobenchmark APK locally from the combined build, ran make format api.

📝 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

#skip-changelog

🤖 Generated with Claude Code

@sentry

sentry Bot commented Nov 16, 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

@runningcode
runningcode marked this pull request as ready for review November 16, 2026 09:17
@runningcode
runningcode requested review from a team and adinauer as code owners November 16, 2026 09:17
@runningcode
runningcode requested review from markushi and romtsn and removed request for a team November 16, 2026 09:17
Move the Android sample and its macrobenchmark into the
sentry-android-integration-tests build, next to the UI tests and the size
test, so every Android app that exercises the SDK lives in one folder and
one build.

The sample becomes a subproject instead of its build's root project, so
its own settings and symlinked Gradle files go away. The macrobenchmark
gets back its pre-#6391 name, sentry-uitest-android-macrobenchmark, which
matches its namespace and Sauce config.

CI, the Makefile and the docs follow the new paths, and the Samples
workflow checks one Android build instead of two.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/android-single-composite-build branch from ca36a36 to f984ec7 Compare November 16, 2026 09:18

@romtsn romtsn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving but one question:

  • should sentry-android-integration-tests be renamed to something different now that it contains the sample as well?

@runningcode

runningcode commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Yeah i had that same thought but the sample is an integration test as well so i thought the name suited. Open to other suggestions though!

@runningcode
runningcode merged commit 4fc0b1e into main Nov 17, 2026
45 of 48 checks passed
@runningcode
runningcode deleted the no/android-single-composite-build branch November 17, 2026 10:19
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