forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
95 lines (78 loc) · 2.29 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
plugins {
id("otel.java-conventions")
id("otel.publish-conventions")
}
description = "OpenTelemetry Prometheus Exporter"
otelJava.moduleName.set("io.opentelemetry.exporter.prometheus")
dependencies {
api(project(":sdk:metrics"))
implementation(project(":exporters:common"))
implementation(project(":sdk-extensions:autoconfigure-spi"))
implementation("io.prometheus:prometheus-metrics-exporter-httpserver")
compileOnly("com.google.auto.value:auto-value-annotations")
annotationProcessor("com.google.auto.value:auto-value")
testImplementation(project(":sdk:testing"))
testImplementation("io.opentelemetry.proto:opentelemetry-proto")
testImplementation("com.sun.net.httpserver:http")
testImplementation("com.google.guava:guava")
testImplementation("com.linecorp.armeria:armeria")
testImplementation("com.linecorp.armeria:armeria-junit5")
testImplementation("com.linecorp.armeria:armeria-grpc-protocol")
testImplementation("com.fasterxml.jackson.jr:jackson-jr-stree")
testImplementation("com.fasterxml.jackson.jr:jackson-jr-objects")
testImplementation("org.testcontainers:junit-jupiter")
}
tasks {
check {
dependsOn(testing.suites)
}
}
// TODO(anuraaga): Move to conventions.
testing {
suites {
register<JvmTestSuite>("testJpms") {
targets {
all {
testTask.configure {
enabled = gradle.startParameter.projectProperties.get("testJavaVersion") != "8"
}
}
}
}
}
}
sourceSets {
val module by creating
main {
output.dir(mapOf("builtBy" to "compileModuleJava"), module.java.destinationDirectory)
}
}
configurations {
named("moduleImplementation") {
extendsFrom(configurations["implementation"])
}
}
tasks {
jar {
manifest.attributes.remove("Automatic-Module-Name")
exclude("**/HackForJpms.class")
}
compileJava {
exclude("module-info.java")
}
withType<Checkstyle>().configureEach {
exclude("module-info.java")
}
named<JavaCompile>("compileModuleJava") {
with(options) {
release.set(9)
}
}
named<JavaCompile>("compileTestJpmsJava") {
with(options) {
release.set(9)
compilerArgs.add("--add-modules=org.junit.jupiter.api")
compilerArgs.add("--add-reads=io.opentelemetry.exporters.prometheus.test=org.junit.jupiter.api")
}
}
}