-
Notifications
You must be signed in to change notification settings - Fork 133
/
Copy pathbuild.gradle.kts
63 lines (52 loc) · 2.17 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
plugins {
id("java")
id("com.github.johnrengelman.shadow")
id("otel.java-conventions")
id("otel.publish-conventions")
}
// NOTE
// `META-INF/sis/javax.inject.Named` is manually handled under src/main/resources because there is
// no Gradle equivalent to the Maven plugin `org.eclipse.sisu:sisu-maven-plugin`
description = "Maven extension to observe Maven builds with distributed traces using OpenTelemetry SDK"
otelJava.moduleName.set("io.opentelemetry.maven")
dependencies {
compileOnly("javax.inject:javax.inject:1")
implementation("io.opentelemetry:opentelemetry-api")
implementation("io.opentelemetry:opentelemetry-sdk")
implementation("io.opentelemetry:opentelemetry-sdk-trace")
implementation("io.opentelemetry:opentelemetry-sdk-metrics")
implementation("io.opentelemetry:opentelemetry-sdk-logs")
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
implementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
implementation("io.opentelemetry.semconv:opentelemetry-semconv")
testImplementation("io.opentelemetry.semconv:opentelemetry-semconv-incubating")
annotationProcessor("com.google.auto.value:auto-value")
compileOnly("com.google.auto.value:auto-value-annotations")
compileOnly("org.apache.maven:maven-core:3.5.0") // do not auto-update, support older mvn versions
compileOnly("org.slf4j:slf4j-api")
testImplementation("org.apache.maven:maven-core:3.5.0")
testImplementation("org.slf4j:slf4j-simple")
}
// The jar dependencies bundled in the uber-jar by the shadow plugin are wrongly added as
// 'runtime' dependencies in the generated pom.xml instead of being absent this pom.xml.
// Remove those runtime dependencies from the pom.xml.
configure<PublishingExtension> {
(components["java"] as AdhocComponentWithVariants).run {
withVariantsFromConfiguration(configurations["runtimeElements"]) {
skip()
}
}
}
tasks {
shadowJar {
manifest {
attributes["Implementation-Version"] = project.version
}
archiveClassifier.set("")
}
assemble {
dependsOn(shadowJar)
}
}
tasks.getByName("test").dependsOn("shadowJar")