-
-
Notifications
You must be signed in to change notification settings - Fork 476
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
137 lines (108 loc) · 4.59 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
137 lines (108 loc) · 4.59 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import org.jetbrains.kotlin.config.KotlinCompilerVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.tasks.run.BootRun
plugins {
alias(libs.plugins.springboot3)
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.spring)
}
group = "io.sentry.sample.spring-boot-jakarta"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
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
}
tasks.withType<KotlinCompile>().configureEach {
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
tasks.withType<KotlinCompile>().configureEach {
kotlin {
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict")
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
dependencies {
implementation(libs.springboot3.starter)
implementation(libs.springboot3.starter.actuator)
implementation(libs.springboot3.starter.aop)
implementation(libs.springboot3.starter.graphql)
implementation(libs.springboot3.starter.jdbc)
implementation(libs.springboot3.starter.quartz)
implementation(libs.springboot3.starter.security)
implementation(libs.springboot3.starter.web)
implementation(libs.springboot3.starter.webflux)
implementation(libs.springboot3.starter.websocket)
implementation(Config.Libs.aspectj)
implementation(Config.Libs.kotlinReflect)
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
implementation(projects.sentrySpringBootStarterJakarta)
implementation(projects.sentryLogback)
implementation(projects.sentryGraphql22)
implementation(projects.sentryQuartz)
implementation(libs.otel)
implementation(projects.sentryAsyncProfiler)
// kafka
implementation(libs.spring.kafka3)
implementation(projects.sentryKafka)
// cache tracing
implementation(libs.springboot3.starter.cache)
implementation(libs.caffeine)
// database query tracing
implementation(projects.sentryJdbc)
runtimeOnly(libs.hsqldb)
testImplementation(kotlin(Config.kotlinStdLib))
testImplementation(projects.sentrySystemTestSupport)
testImplementation(libs.apollo3.kotlin)
testImplementation(libs.kotlin.test.junit)
testImplementation(libs.slf4j2.api)
testImplementation(libs.springboot3.starter.test) {
exclude(group = "org.junit.vintage", module = "junit-vintage-engine")
}
testImplementation("ch.qos.logback:logback-classic:1.5.16")
testImplementation("ch.qos.logback:logback-core:1.5.16")
}
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }
tasks.register<BootRun>("bootRunWithAgent").configure {
group = "application"
val mainBootRunTask = tasks.getByName<BootRun>("bootRun")
mainClass = mainBootRunTask.mainClass
classpath = mainBootRunTask.classpath
val versionName = project.properties["versionName"] as String
val agentJarPath =
"$rootDir/sentry-opentelemetry/sentry-opentelemetry-agent/build/libs/sentry-opentelemetry-agent-$versionName.jar"
val dsn =
System.getenv("SENTRY_DSN")
?: "https://502f25099c204a2fbf4cb16edc5975d1@o447951.ingest.sentry.io/5428563"
val tracesSampleRate = System.getenv("SENTRY_TRACES_SAMPLE_RATE") ?: "1"
environment("SENTRY_DSN", dsn)
environment("SENTRY_DEBUG", "true")
environment("SENTRY_PROFILE_SESSION_SAMPLE_RATE", "1.0")
environment("SENTRY_PROFILING_TRACES_DIR_PATH", "tmp/sentry/profiling-traces")
environment("SENTRY_PROFILE_LIFECYCLE", "TRACE")
environment("SENTRY_TRACES_SAMPLE_RATE", tracesSampleRate)
environment("OTEL_TRACES_EXPORTER", "none")
environment("OTEL_METRICS_EXPORTER", "none")
environment("OTEL_LOGS_EXPORTER", "none")
environment("SENTRY_IN_APP_INCLUDES", "io.sentry.samples")
environment("SENTRY_ENABLE_PRETTY_SERIALIZATION_OUTPUT", "false")
jvmArgs = listOf("-Dotel.javaagent.debug=true", "-javaagent:$agentJarPath")
}
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 }
filter { includeTestsMatching("io.sentry.systemtest*") }
}
tasks.named("test").configure {
require(this is Test)
filter { excludeTestsMatching("io.sentry.systemtest.*") }
}