Migrate jacoco.gradle to plugin (#3330)
This commit is contained in:
parent
d8ff44bf40
commit
91a2c18f30
|
@ -0,0 +1,19 @@
|
||||||
|
plugins {
|
||||||
|
jacoco
|
||||||
|
}
|
||||||
|
|
||||||
|
jacoco {
|
||||||
|
toolVersion = "0.8.6"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
|
named<JacocoReport>("jacocoTestReport") {
|
||||||
|
dependsOn("test")
|
||||||
|
|
||||||
|
reports {
|
||||||
|
xml.isEnabled = true
|
||||||
|
csv.isEnabled = false
|
||||||
|
html.destination = file("${buildDir}/reports/jacoco/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,17 +27,6 @@ afterEvaluate {
|
||||||
// Version to use to compile code and run tests.
|
// Version to use to compile code and run tests.
|
||||||
val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_11
|
val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_11
|
||||||
|
|
||||||
val applyCodeCoverage = !project.path.run {
|
|
||||||
startsWith(":smoke-tests") ||
|
|
||||||
startsWith(":benchmark") ||
|
|
||||||
startsWith(":instrumentation") ||
|
|
||||||
startsWith(":testing-common")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applyCodeCoverage) {
|
|
||||||
apply(from = "${rootDir}/gradle/jacoco.gradle")
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain {
|
toolchain {
|
||||||
languageVersion.set(otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) })
|
languageVersion.set(otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) })
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
plugins {
|
plugins {
|
||||||
id("otel.java-conventions")
|
id("otel.java-conventions")
|
||||||
|
id("otel.jacoco-conventions")
|
||||||
id("otel.publish-conventions")
|
id("otel.publish-conventions")
|
||||||
id("otel.instrumentation-conventions")
|
id("otel.instrumentation-conventions")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
apply plugin: "jacoco"
|
|
||||||
|
|
||||||
jacoco {
|
|
||||||
toolVersion = "0.8.6"
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.named('jacocoTestReport').configure {
|
|
||||||
dependsOn('test')
|
|
||||||
reports {
|
|
||||||
xml.enabled true
|
|
||||||
csv.enabled false
|
|
||||||
html.destination file("${buildDir}/reports/jacoco/")
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,6 +5,7 @@ plugins {
|
||||||
group = 'io.opentelemetry.instrumentation'
|
group = 'io.opentelemetry.instrumentation'
|
||||||
|
|
||||||
apply plugin: "otel.java-conventions"
|
apply plugin: "otel.java-conventions"
|
||||||
|
apply plugin: "otel.jacoco-conventions"
|
||||||
apply plugin: "otel.publish-conventions"
|
apply plugin: "otel.publish-conventions"
|
||||||
|
|
||||||
def jflexTargetDir = file"${project.buildDir}/generated/jflex/sql"
|
def jflexTargetDir = file"${project.buildDir}/generated/jflex/sql"
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
group = 'io.opentelemetry.javaagent'
|
group = 'io.opentelemetry.javaagent'
|
||||||
|
|
||||||
apply plugin: "otel.java-conventions"
|
apply plugin: "otel.java-conventions"
|
||||||
|
apply plugin: "otel.jacoco-conventions"
|
||||||
apply plugin: "otel.publish-conventions"
|
apply plugin: "otel.publish-conventions"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
Loading…
Reference in New Issue