forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
66 lines (54 loc) · 1.48 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
plugins {
id("otel.java-conventions")
id("otel.publish-conventions")
id("otel.animalsniffer-conventions")
}
description = "OpenTelemetry SDK Resource Providers"
otelJava.moduleName.set("io.opentelemetry.sdk.extension.resources")
val mrJarVersions = listOf(11)
dependencies {
api(project(":sdk:common"))
implementation(project(":semconv"))
compileOnly(project(":sdk-extensions:autoconfigure"))
compileOnly("org.codehaus.mojo:animal-sniffer-annotations")
}
for (version in mrJarVersions) {
sourceSets {
create("java$version") {
java {
setSrcDirs(listOf("src/main/java$version"))
}
}
}
tasks {
named<JavaCompile>("compileJava${version}Java") {
sourceCompatibility = "$version"
targetCompatibility = "$version"
options.release.set(version)
}
}
configurations {
named("java${version}Implementation") {
extendsFrom(configurations["implementation"])
}
named("java${version}CompileOnly") {
extendsFrom(configurations["compileOnly"])
}
}
dependencies {
// Common to reference classes in main sourceset from Java 9 one (e.g., to return a common interface)
add("java${version}Implementation", files(sourceSets.main.get().output.classesDirs))
}
}
tasks {
withType(Jar::class) {
for (version in mrJarVersions) {
into("META-INF/versions/$version") {
from(sourceSets["java$version"].output)
}
}
manifest.attributes(
"Multi-Release" to "true"
)
}
}