-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
59 lines (46 loc) · 1.51 KB
/
build.gradle.kts
File metadata and controls
59 lines (46 loc) · 1.51 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
import org.springframework.boot.gradle.plugin.SpringBootPlugin
import org.springframework.boot.gradle.tasks.bundling.BootJar
plugins {
id("java")
id("org.springframework.boot") version "3.5.6"
}
val moduleName by extra { "io.opentelemetry.examples.reference-application" }
repositories {
mavenCentral()
}
val agent = configurations.create("agent")
dependencies {
implementation(platform(SpringBootPlugin.BOM_COORDINATES))
implementation("io.opentelemetry:opentelemetry-api")
// Spring Boot
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
// Java agent
agent("io.opentelemetry.javaagent:opentelemetry-javaagent:2.20.1")
// Testing
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
}
val copyAgent = tasks.register<Copy>("copyAgent") {
from(agent.singleFile)
into(layout.buildDirectory.dir("agent"))
rename("opentelemetry-javaagent-.*\\.jar", "opentelemetry-javaagent.jar")
}
tasks.named<BootJar>("bootJar") {
dependsOn(copyAgent)
archiveFileName = "app.jar"
}
tasks.withType<Test> {
useJUnitPlatform()
}
tasks.register<Exec>("e2eTest") {
group = "verification"
description = "Run end-to-end test using docker-compose"
commandLine("./test-e2e.sh")
dependsOn("bootJar")
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}