From 4f19f1474f69adf6719157cae5b50d1a71e66f85 Mon Sep 17 00:00:00 2001 From: zpencer Date: Tue, 13 Mar 2018 17:46:03 -0700 Subject: [PATCH] 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. --- build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.gradle b/build.gradle index 157b23ef9e..f34da55d98 100644 --- a/build.gradle +++ b/build.gradle @@ -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) {