-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
101 lines (90 loc) · 2.57 KB
/
build.gradle.kts
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("com.github.johnrengelman.shadow")
id("otel.java-conventions")
}
description = "opentelemetry-api shaded for internal javaagent usage"
group = "io.opentelemetry.javaagent"
val latestDeps by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
}
val v1_10Deps by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
// exclude the bom added by dependencyManagement
exclude("io.opentelemetry", "opentelemetry-bom")
}
val v1_15Deps by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
// exclude the bom added by dependencyManagement
exclude("io.opentelemetry", "opentelemetry-bom")
}
val v1_27Deps by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
// exclude the bom added by dependencyManagement
exclude("io.opentelemetry", "opentelemetry-bom")
}
// configuration for publishing the shadowed artifact
val v1_10 by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}
val v1_15 by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}
val v1_27 by configurations.creating {
isCanBeConsumed = true
isCanBeResolved = false
}
dependencies {
latestDeps("io.opentelemetry:opentelemetry-api")
listOf("opentelemetry-api", "opentelemetry-context").forEach {
v1_10Deps("io.opentelemetry:$it") {
version {
strictly("1.10.0")
}
}
v1_15Deps("io.opentelemetry:$it") {
version {
strictly("1.15.0")
}
}
v1_27Deps("io.opentelemetry:$it") {
version {
strictly("1.27.0")
}
}
}
}
// OpenTelemetry API shaded so that it can be used in instrumentation of OpenTelemetry API itself,
// and then its usage can be unshaded after OpenTelemetry API is shaded
// (see more explanation in opentelemetry-api-1.0.gradle)
tasks {
withType<ShadowJar>().configureEach {
relocate("io.opentelemetry", "application.io.opentelemetry")
}
shadowJar {
configurations = listOf(latestDeps)
}
val v1_10Shadow by registering(ShadowJar::class) {
configurations = listOf(v1_10Deps)
archiveClassifier.set("v1_10")
}
val v1_15Shadow by registering(ShadowJar::class) {
configurations = listOf(v1_15Deps)
archiveClassifier.set("v1_15")
}
val v1_27Shadow by registering(ShadowJar::class) {
configurations = listOf(v1_27Deps)
archiveClassifier.set("v1_27")
}
artifacts {
add(v1_10.name, v1_10Shadow)
add(v1_15.name, v1_15Shadow)
add(v1_27.name, v1_27Shadow)
}
}