forked from open-telemetry/opentelemetry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
97 lines (80 loc) · 2.04 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
plugins {
id("otel.java-conventions")
id("otel.publish-conventions")
id("otel.animalsniffer-conventions")
}
description = "OpenTelemetry Prometheus Exporter"
otelJava.moduleName.set("io.opentelemetry.exporter.prometheus")
dependencies {
api(project(":sdk:metrics"))
compileOnly("com.sun.net.httpserver:http")
testImplementation("com.google.guava:guava")
testImplementation("com.linecorp.armeria:armeria")
}
testing {
suites {
val integrationTest by registering(JvmTestSuite::class) {
dependencies {
implementation("com.fasterxml.jackson.jr:jackson-jr-stree")
implementation("com.google.guava:guava")
implementation("com.linecorp.armeria:armeria")
implementation("io.prometheus:simpleclient_httpserver")
implementation("org.testcontainers:junit-jupiter")
}
}
}
}
tasks {
check {
dependsOn(testing.suites)
}
}
// TODO(anuraaga): Move to conventions.
testing {
suites {
val testJpms by registering(JvmTestSuite::class) {
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")
}
val compileModuleJava by existing(JavaCompile::class) {
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")
}
}
}