Skip to content
Draft
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ apiValidation {
"test-app-sentry",
"test-app-size",
"sentry-samples-netflix-dgs",
"sentry-samples-console-otlp"
"sentry-samples-console-otlp",
"sentry-test-support",
"sentry-system-test-support"
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,13 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.8" }
jacoco-android = { id = "com.mxalbert.gradle.jacoco-android", version = "0.2.0" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.3" }
vanniktech-maven-publish = { id = "com.vanniktech.maven.publish", version = "0.30.0" }
springboot2 = { id = "org.springframework.boot", version.ref = "springboot2" }
springboot3 = { id = "org.springframework.boot", version.ref = "springboot3" }
springboot4 = { id = "org.springframework.boot", version.ref = "springboot4" }
spring-dependency-management = { id = "io.spring.dependency-management", version = "1.1.7" }
gretty = { id = "org.gretty", version = "4.0.0" }
animalsniffer = { id = "ru.vyarus.animalsniffer", version = "2.0.1" }
sentry = { id = "io.sentry.android.gradle", version = "6.0.0-alpha.6"}
shadow = { id = "com.gradleup.shadow", version = "8.3.6" }
shadow = { id = "com.gradleup.shadow", version = "9.4.1" }

[libraries]
apache-httpclient = { module = "org.apache.httpcomponents.client5:httpclient5", version = "5.0.4" }
Expand Down Expand Up @@ -159,6 +158,7 @@ slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" }
slf4j2-api = { module = "org.slf4j:slf4j-api", version = "2.0.5" }
spotlessLib = { module = "com.diffplug.spotless:com.diffplug.spotless.gradle.plugin", version.ref = "spotless"}
springboot2-bom = { module = "org.springframework.boot:spring-boot-dependencies", version.ref = "springboot2" }
springboot-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot2" }
springboot-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot2" }
springboot-starter-quartz = { module = "org.springframework.boot:spring-boot-starter-quartz", version.ref = "springboot2" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ tasks {

archiveClassifier.set("")

duplicatesStrategy = DuplicatesStrategy.FAIL
// INCLUDE is required so that mergeServiceFiles can see duplicates from both the
// upstream agent JAR and the isolated distro libs before they are deduplicated.
// Shadow 9.x enforces duplicatesStrategy before transformers run, so FAIL/EXCLUDE
// would prevent service file merging.
duplicatesStrategy = DuplicatesStrategy.INCLUDE

mergeServiceFiles { include("inst/META-INF/services/*") }
exclude("**/module-info.class")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-console-otlp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-console/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-jul/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-log4j2/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-logback/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
27 changes: 25 additions & 2 deletions sentry-samples/sentry-samples-netflix-dgs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.springboot2)
alias(libs.plugins.spring.dependency.management)
java
application
alias(libs.plugins.shadow)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.spring)
}

application { mainClass.set("io.sentry.samples.netflix.dgs.NetlixDgsApplication") }

group = "io.sentry.sample.spring-boot"

version = "0.0.1-SNAPSHOT"
Expand All @@ -19,6 +22,7 @@ java.targetCompatibility = JavaVersion.VERSION_1_8
repositories { mavenCentral() }

dependencies {
implementation(platform(libs.springboot2.bom))
implementation(libs.springboot.starter.web)
implementation(Config.Libs.kotlinReflect)
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
Expand All @@ -32,6 +36,25 @@ dependencies {
}
}

// Configure the Shadow JAR (executable JAR with all dependencies)
tasks.shadowJar {
manifest { attributes["Main-Class"] = "io.sentry.samples.netflix.dgs.NetlixDgsApplication" }
archiveClassifier.set("")
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
append("META-INF/spring.handlers")
append("META-INF/spring.schemas")
append("META-INF/spring.factories")
append("META-INF/spring-autoconfigure-metadata.properties")
}

tasks.jar {
enabled = false
dependsOn(tasks.shadowJar)
}

tasks.startScripts { dependsOn(tasks.shadowJar) }

tasks.withType<Test>().configureEach { useJUnitPlatform() }

tasks.withType<KotlinCompile>().configureEach {
Expand Down
4 changes: 4 additions & 0 deletions sentry-samples/sentry-samples-spring-7/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ java.targetCompatibility = JavaVersion.VERSION_17

repositories { mavenCentral() }

// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
extra["kotlin-coroutines.version"] = "1.9.0"

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -80,6 +83,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ java.targetCompatibility = JavaVersion.VERSION_17

repositories { mavenCentral() }

// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
extra["kotlin-coroutines.version"] = "1.9.0"

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -114,6 +117,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ java.targetCompatibility = JavaVersion.VERSION_17

repositories { mavenCentral() }

// Apollo 4.x requires coroutines 1.9.0+, override Spring Boot's managed version
extra["kotlin-coroutines.version"] = "1.9.0"

configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -69,7 +72,6 @@ dependencies {
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(projects.sentry)
testImplementation(projects.sentrySystemTestSupport)
testImplementation(libs.apollo3.kotlin)
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.slf4j2.api)
testImplementation(libs.springboot3.starter.test) {
Expand All @@ -85,6 +87,10 @@ tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.springboot2)
alias(libs.plugins.spring.dependency.management)
java
application
alias(libs.plugins.shadow)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.spring)
}

application { mainClass.set("io.sentry.samples.spring.boot.SentryDemoApplication") }

group = "io.sentry.sample.spring-boot"

version = "0.0.1-SNAPSHOT"
Expand Down Expand Up @@ -35,6 +38,8 @@ tasks.withType<KotlinCompile>().configureEach {
}

dependencies {
implementation(platform(libs.springboot2.bom))
implementation(platform(libs.otel.instrumentation.bom))
implementation(libs.springboot.starter)
implementation(libs.springboot.starter.actuator)
implementation(libs.springboot.starter.aop)
Expand Down Expand Up @@ -72,14 +77,35 @@ dependencies {
testImplementation("org.apache.httpcomponents:httpclient")
}

dependencyManagement { imports { mavenBom(libs.otel.instrumentation.bom.get().toString()) } }
// Configure the Shadow JAR (executable JAR with all dependencies)
tasks.shadowJar {
manifest { attributes["Main-Class"] = "io.sentry.samples.spring.boot.SentryDemoApplication" }
archiveClassifier.set("")
duplicatesStrategy = DuplicatesStrategy.INCLUDE
mergeServiceFiles()
append("META-INF/spring.handlers")
append("META-INF/spring.schemas")
append("META-INF/spring.factories")
append("META-INF/spring-autoconfigure-metadata.properties")
}

tasks.jar {
enabled = false
dependsOn(tasks.shadowJar)
}

tasks.startScripts { dependsOn(tasks.shadowJar) }

configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }

tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"

val test = project.extensions.getByType<SourceSetContainer>()["test"]
testClassesDirs = test.output.classesDirs
classpath = test.runtimeClasspath

outputs.upToDateWhen { false }

maxParallelForks = 1
Expand Down
Loading
Loading