buildscript: read jmh include class from project property (#4215)

The project property can be set form the CLI, so that it is simple to
run JMH on a single class.
This commit is contained in:
zpencer 2018-03-13 17:46:03 -07:00 committed by GitHub
parent 2761bbb851
commit 4f19f1474f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -288,6 +288,8 @@ subprojects {
source = fileTree(dir: "src/test", include: "**/*.java")
}
// invoke jmh on a single benchmark class like so:
// ./gradlew -PjmhIncludeSingleClass=StatsTraceContextBenchmark clean :grpc-core:jmh
jmh {
warmupIterations = 10
iterations = 10
@ -296,6 +298,9 @@ subprojects {
// dependencies that break when including them. (context's testCompile
// depends on core; core's testCompile depends on testing)
includeTests = false
if (project.hasProperty('jmhIncludeSingleClass')) {
include = [project.property('jmhIncludeSingleClass')]
}
}
task javadocJar(type: Jar) {