Repository navigation
Commit 14c2936
build(samples): [Sample Tests 44] Prepare the samples to build outside the SDK build (#6391)
* build(samples): Prepare the samples to build outside the SDK build
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>
* Apply suggestion from @romtsn
* build(samples): Move the Android sample to its own build
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>
* ci(samples): Run the Android sample's check in its own workflow
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>
* ci(samples): Drop the Gradle encryption key and buildSrc cache from the Samples workflow
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* ci(samples): Check out the default ref without submodules in the Samples 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>
* build(samples): Link the Android sample's Gradle files to the SDK build'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>
* ci(samples): Drop the JUnit report step from the Samples workflow
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>
* build(samples): Bring back make format for every build
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>
* build(samples): Read the sample's SDK version through the catalog
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>
* ci(samples): Use the setup-gradle version of the other workflows
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(samples): Drop the comment on the macrobenchmark's target project
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(samples): Drop the header comment from the Android sample's settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(samples): Move the Android integration tests to their own build
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>
* ci(samples): Run the Android integration tests' check in the Samples 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>
* build: Drop the root's SAGP declaration and local SAGP repository
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>
* build(samples): Link the integration tests' Gradle files to the SDK build'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>
* build(samples): Include each integration test project on its own line
Adding or removing a project then changes only its own line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(samples): Keep the integration tests' Develocity and dependency 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>
* build(samples): Drop the comment on the integration tests' root plugins
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* build(samples): Drop the header comment from the integration tests' settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>1 parent 1b8668a commit 14c2936
59 files changed
Lines changed: 426 additions & 192 deletions
File tree
- .claude/skills/create-java-pr
- .github
- workflows
- .sauce
- build-logic/src/main/kotlin/io/sentry/gradle
- buildSrc/src/main/java
- gradle
- scripts
- sentry-android-integration-tests
- gradle
- sentry-uitest-android-critical
- sentry-uitest-android
- test-app-size
- sentry-samples
- sentry-samples-android
- gradle
- macrobenchmark
- src/main
- java/io/sentry/uitest/android/macrobenchmark
- sentry-samples-netflix-dgs
- sentry-samples-spring-7
- sentry-samples-spring-boot-4-log4j2
- sentry-samples-spring-boot-4-opentelemetry-noagent
- sentry-samples-spring-boot-4-opentelemetry
- sentry-samples-spring-boot-4-otlp
- sentry-samples-spring-boot-4-webflux
- sentry-samples-spring-boot-4
- sentry-samples-spring-boot-jakarta-log4j2
- sentry-samples-spring-boot-jakarta-opentelemetry-noagent
- sentry-samples-spring-boot-jakarta-opentelemetry
- sentry-samples-spring-boot-jakarta
- sentry-samples-spring-boot-opentelemetry-noagent
- sentry-samples-spring-boot-opentelemetry
- sentry-samples-spring-boot-webflux-jakarta
- sentry-samples-spring-boot-webflux
- sentry-samples-spring-boot
- sentry-samples-spring-jakarta
- sentry-samples-spring
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 76 | + | |
81 | 77 | | |
82 | 78 | | |
83 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | 36 | | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
33 | 41 | | |
34 | 42 | | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
38 | | - | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | | - | |
| 50 | + | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| |||
0 commit comments