Apply JMH plugin explicitly when needed

This commit is contained in:
Eric Anderson 2019-09-07 09:03:53 -07:00
parent 3c3a823a81
commit 55ac6f08af
6 changed files with 39 additions and 29 deletions

View File

@ -1,3 +1,7 @@
plugins {
id "me.champeau.gradle.jmh"
}
description = 'gRPC: API'
dependencies {

View File

@ -2,6 +2,7 @@ plugins {
id "application"
id "com.google.protobuf"
id "me.champeau.gradle.jmh"
}
description = "grpc Benchmarks"

View File

@ -1,7 +1,6 @@
plugins {
id "com.google.osdetector" apply false
id "me.champeau.gradle.japicmp" apply false
id "me.champeau.gradle.jmh" apply false
id "net.ltgt.errorprone" apply false
id "ru.vyarus.animalsniffer" apply false
}
@ -17,7 +16,6 @@ subprojects {
apply plugin: "signing"
apply plugin: "jacoco"
apply plugin: "me.champeau.gradle.jmh"
apply plugin: "com.google.osdetector"
// The plugin only has an effect if a signature is specified
apply plugin: "ru.vyarus.animalsniffer"
@ -53,11 +51,7 @@ subprojects {
mavenLocal()
}
[
compileJava,
compileTestJava,
compileJmhJava
].each() {
tasks.withType(JavaCompile) {
it.options.compilerArgs += [
"-Xlint:all",
"-Xlint:-options",
@ -160,11 +154,7 @@ subprojects {
}
}
[
compileJava,
compileTestJava,
compileJmhJava
].each() {
tasks.withType(JavaCompile) {
// Protobuf-generated code produces some warnings.
// https://github.com/google/protobuf/issues/2718
it.options.compilerArgs += [
@ -253,9 +243,6 @@ subprojects {
// Configuration for modules that use Jetty ALPN agent
alpnagent libraries.jetty_alpn_agent
jmh 'org.openjdk.jmh:jmh-core:1.19',
'org.openjdk.jmh:jmh-generator-bytecode:1.19'
}
// Disable JavaDoc doclint on Java 8. It's annoying.
@ -295,6 +282,11 @@ subprojects {
source = fileTree(dir: "src/test", include: "**/*.java")
}
plugins.withId("me.champeau.gradle.jmh") {
dependencies {
jmh 'org.openjdk.jmh:jmh-core:1.19',
'org.openjdk.jmh:jmh-generator-bytecode:1.19'
}
// invoke jmh on a single benchmark class like so:
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
jmh {
@ -311,6 +303,7 @@ subprojects {
]
}
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'

View File

@ -1,3 +1,7 @@
plugins {
id "me.champeau.gradle.jmh"
}
description = 'gRPC: Context'
dependencies {

View File

@ -1,3 +1,7 @@
plugins {
id "me.champeau.gradle.jmh"
}
description = 'gRPC: Core'
dependencies {

View File

@ -1,3 +1,7 @@
plugins {
id "me.champeau.gradle.jmh"
}
description = "gRPC: Netty"
dependencies {
compile project(':grpc-core'),