-
-
Notifications
You must be signed in to change notification settings - Fork 466
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
124 lines (99 loc) · 4.19 KB
/
build.gradle.kts
File metadata and controls
124 lines (99 loc) · 4.19 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
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.springboot4)
alias(libs.plugins.spring.dependency.management)
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.spring)
}
group = "io.sentry.sample.spring-boot-4"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_17
java.targetCompatibility = JavaVersion.VERSION_17
repositories { mavenCentral() }
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile>().configureEach {
kotlin {
explicitApi()
// skip metadata version check, as Spring 7 / Spring Boot 4 is
// compiled against a newer version of Kotlin
compilerOptions.freeCompilerArgs = listOf("-Xjsr305=strict", "-Xskip-metadata-version-check")
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9
}
}
dependencies {
implementation(libs.springboot4.starter)
implementation(libs.springboot4.starter.actuator)
implementation(libs.springboot4.starter.aspectj)
implementation(libs.springboot4.starter.graphql)
implementation(libs.springboot4.starter.jdbc)
implementation(libs.springboot4.starter.quartz)
implementation(libs.springboot4.starter.security)
implementation(libs.springboot4.starter.web)
implementation(libs.springboot4.starter.webflux)
implementation(libs.springboot4.starter.websocket)
implementation(libs.springboot4.starter.webclient)
implementation(libs.springboot4.starter.restclient)
implementation(Config.Libs.aspectj)
implementation(Config.Libs.kotlinReflect)
implementation(kotlin(Config.kotlinStdLib, KotlinCompilerVersion.VERSION))
implementation(projects.sentrySpringBoot4Starter)
implementation(projects.sentryLogback)
implementation(projects.sentryGraphql22)
implementation(projects.sentryQuartz)
implementation(projects.sentryAsyncProfiler)
implementation(libs.otel)
// 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.springboot4.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_TRACES_SAMPLE_RATE", tracesSampleRate)
environment("OTEL_TRACES_EXPORTER", "none")
environment("OTEL_METRICS_EXPORTER", "none")
environment("OTEL_LOGS_EXPORTER", "none")
jvmArgs = listOf("-Dotel.javaagent.debug=true", "-javaagent:$agentJarPath")
}
tasks.register<Test>("systemTest").configure {
group = "verification"
description = "Runs the System tests"
outputs.upToDateWhen { false }
maxParallelForks = 1
// Cap JVM args per test
minHeapSize = "128m"
maxHeapSize = "1g"
filter { includeTestsMatching("io.sentry.systemtest*") }
}
tasks.named("test").configure {
require(this is Test)
filter { excludeTestsMatching("io.sentry.systemtest.*") }
}