Extract JMH conventions plugin. (#3324)
This commit is contained in:
parent
7f544416e4
commit
864508983e
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
import com.google.protobuf.gradle.*
|
||||
import de.marcphilipp.gradle.nexus.NexusPublishExtension
|
||||
import io.morethan.jmhreport.gradle.JmhReportExtension
|
||||
import me.champeau.gradle.japicmp.JapicmpTask
|
||||
import me.champeau.jmh.JmhParameters
|
||||
import nebula.plugin.release.git.opinion.Strategies
|
||||
import org.gradle.api.plugins.JavaPlugin.*
|
||||
import ru.vyarus.gradle.plugin.animalsniffer.AnimalSnifferExtension
|
||||
|
|
@ -18,7 +16,7 @@ plugins {
|
|||
id("com.google.protobuf") apply false
|
||||
id("de.marcphilipp.nexus-publish") apply false
|
||||
id("io.morethan.jmhreport") apply false
|
||||
id("me.champeau.jmh") apply false
|
||||
id("otel.jmh-conventions") apply false
|
||||
id("ru.vyarus.animalsniffer") apply false
|
||||
id("me.champeau.gradle.japicmp") apply false
|
||||
}
|
||||
|
|
@ -142,48 +140,6 @@ subprojects {
|
|||
}
|
||||
}
|
||||
|
||||
plugins.withId("me.champeau.jmh") {
|
||||
// Always include the jmhreport plugin and run it after jmh task.
|
||||
plugins.apply("io.morethan.jmhreport")
|
||||
dependencies {
|
||||
add("jmh", platform(project(":dependencyManagement")))
|
||||
add("jmh", "org.openjdk.jmh:jmh-core")
|
||||
add("jmh", "org.openjdk.jmh:jmh-generator-bytecode")
|
||||
}
|
||||
|
||||
// invoke jmh on a single benchmark class like so:
|
||||
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
|
||||
configure<JmhParameters> {
|
||||
failOnError.set(true)
|
||||
resultFormat.set("JSON")
|
||||
// Otherwise an error will happen:
|
||||
// Could not expand ZIP 'byte-buddy-agent-1.9.7.jar'.
|
||||
includeTests.set(false)
|
||||
profilers.add("gc")
|
||||
val jmhIncludeSingleClass: String? by project
|
||||
if (jmhIncludeSingleClass != null) {
|
||||
includes.add(jmhIncludeSingleClass as String)
|
||||
}
|
||||
}
|
||||
|
||||
configure<JmhReportExtension> {
|
||||
jmhResultPath = file("${buildDir}/results/jmh/results.json").absolutePath
|
||||
jmhReportOutput = file("${buildDir}/results/jmh").absolutePath
|
||||
}
|
||||
|
||||
tasks {
|
||||
// TODO(anuraaga): Unclear why this is triggering even though there don't seem to
|
||||
// be duplicates, possibly a bug in JMH plugin.
|
||||
named<ProcessResources>("processJmhResources") {
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
|
||||
named("jmh") {
|
||||
finalizedBy(named("jmhReport"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugins.withId("me.champeau.gradle.japicmp") {
|
||||
afterEvaluate {
|
||||
tasks {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
implementation("com.diffplug.spotless:spotless-plugin-gradle:5.13.0")
|
||||
implementation("gradle.plugin.io.morethan.jmhreport:gradle-jmh-report:0.9.0")
|
||||
implementation("me.champeau.jmh:jmh-gradle-plugin:0.6.5")
|
||||
implementation("net.ltgt.gradle:gradle-errorprone-plugin:2.0.1")
|
||||
implementation("net.ltgt.gradle:gradle-nullaway-plugin:1.1.0")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
plugins {
|
||||
id("me.champeau.jmh")
|
||||
id("io.morethan.jmhreport")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
jmh(platform(project(":dependencyManagement")))
|
||||
jmh("org.openjdk.jmh:jmh-core")
|
||||
jmh("org.openjdk.jmh:jmh-generator-bytecode")
|
||||
}
|
||||
|
||||
// invoke jmh on a single benchmark class like so:
|
||||
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
|
||||
jmh {
|
||||
failOnError.set(true)
|
||||
resultFormat.set("JSON")
|
||||
// Otherwise an error will happen:
|
||||
// Could not expand ZIP 'byte-buddy-agent-1.9.7.jar'.
|
||||
includeTests.set(false)
|
||||
profilers.add("gc")
|
||||
val jmhIncludeSingleClass: String? by project
|
||||
if (jmhIncludeSingleClass != null) {
|
||||
includes.add(jmhIncludeSingleClass as String)
|
||||
}
|
||||
}
|
||||
|
||||
jmhReport {
|
||||
jmhResultPath = file("${buildDir}/results/jmh/results.json").absolutePath
|
||||
jmhReportOutput = file("${buildDir}/results/jmh").absolutePath
|
||||
}
|
||||
|
||||
tasks {
|
||||
named("jmh") {
|
||||
finalizedBy(named("jmhReport"))
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("org.unbroken-dome.test-sets")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("org.unbroken-dome.test-sets")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("org.jetbrains.kotlin.jvm")
|
||||
id("org.unbroken-dome.test-sets")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ plugins {
|
|||
`maven-publish`
|
||||
|
||||
id("ru.vyarus.animalsniffer")
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry Extension : Trace Propagators"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry SDK AWS Instrumentation Support"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
`maven-publish`
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
}
|
||||
|
||||
description = "OpenTelemetry - zPages"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
|
||||
// TODO(anuraaga): Enable animalsniffer by the time we are getting ready to release a stable
|
||||
// version. Long/DoubleAdder are not part of Android API 21 which is our current target.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("otel.java-conventions")
|
||||
id("maven-publish")
|
||||
|
||||
id("me.champeau.jmh")
|
||||
id("otel.jmh-conventions")
|
||||
id("ru.vyarus.animalsniffer")
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ pluginManagement {
|
|||
id("de.marcphilipp.nexus-publish") version "0.4.0"
|
||||
id("de.undercouch.download") version "4.1.1"
|
||||
id("io.codearte.nexus-staging") version "0.30.0"
|
||||
id("io.morethan.jmhreport") version "0.9.0"
|
||||
id("me.champeau.jmh") version "0.6.5"
|
||||
id("nebula.release") version "15.3.1"
|
||||
id("org.checkerframework") version "0.5.20"
|
||||
id("org.jetbrains.kotlin.jvm") version "1.5.10"
|
||||
|
|
|
|||
Loading…
Reference in New Issue