This is an automated email from the ASF dual-hosted git repository.
granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 4e3cf3e [build] Move JMH plugin setup to benchmarks.gradle
4e3cf3e is described below
commit 4e3cf3ef8f19c0df649bbe6f190e8d21c48ee898
Author: Grant Henke <[email protected]>
AuthorDate: Sat Jun 13 08:31:50 2020 -0500
[build] Move JMH plugin setup to benchmarks.gradle
This patch moves the JMH plugin setup from the kudu-client
build.gradle file to a central benchmarks.gradle file. This allows
the common JMH setup to be reused in other modules without
duplicating setup and versions.
Change-Id: I8c560dba9038db1bf6aa4e5e92efc517de2cae28
Reviewed-on: http://gerrit.cloudera.org:8080/16076
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
java/buildSrc/build.gradle | 1 +
java/gradle/benchmarks.gradle | 32 ++++++++++++++++++++++++++++++++
java/gradle/dependencies.gradle | 3 +++
java/kudu-client/build.gradle | 13 +------------
4 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/java/buildSrc/build.gradle b/java/buildSrc/build.gradle
index b9e2018..5fb85a9 100644
--- a/java/buildSrc/build.gradle
+++ b/java/buildSrc/build.gradle
@@ -40,6 +40,7 @@ dependencies {
compile "com.google.code.gson:gson:2.8.6"
compile "cz.alenkacz:gradle-scalafmt:1.7.2"
compile "com.google.guava:guava:29.0-jre"
+ compile "me.champeau.gradle:jmh-gradle-plugin:0.5.0"
}
// Compiler configuration
diff --git a/java/gradle/benchmarks.gradle b/java/gradle/benchmarks.gradle
new file mode 100644
index 0000000..3de899d
--- /dev/null
+++ b/java/gradle/benchmarks.gradle
@@ -0,0 +1,32 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+// This file contains common tasks and configuration for benchmarking.
+
+apply plugin: "me.champeau.gradle.jmh"
+
+// Add the JMH plugin dependencies.
+dependencies {
+ jmh libs.jmhCore
+ jmh libs.jmhGenerator
+}
+
+// Configure the JMH plugin.
+jmh {
+ duplicateClassesStrategy = 'exclude'
+ zip64 = true
+}
diff --git a/java/gradle/dependencies.gradle b/java/gradle/dependencies.gradle
index 0e6eae6..04b47e5 100755
--- a/java/gradle/dependencies.gradle
+++ b/java/gradle/dependencies.gradle
@@ -42,6 +42,7 @@ versions += [
httpClient : "4.5.12",
jepsen : "0.1.5",
jetty : "9.4.28.v20200408",
+ jmh : "1.23",
jsr305 : "3.0.2",
junit : "4.13",
log4j : "2.11.2",
@@ -95,6 +96,8 @@ libs += [
jepsen : "jepsen:jepsen:$versions.jepsen",
jetty : "org.eclipse.jetty:jetty-server:$versions.jetty",
jettyServlet : "org.eclipse.jetty:jetty-servlet:$versions.jetty",
+ jmhCore : "org.openjdk.jmh:jmh-core:$versions.jmh",
+ jmhGenerator :
"org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh",
jsr305 : "com.google.code.findbugs:jsr305:$versions.jsr305",
junit : "junit:junit:$versions.junit",
log4j :
"org.apache.logging.log4j:log4j-1.2-api:$versions.log4j",
diff --git a/java/kudu-client/build.gradle b/java/kudu-client/build.gradle
index 15ea439..382d746 100644
--- a/java/kudu-client/build.gradle
+++ b/java/kudu-client/build.gradle
@@ -15,12 +15,9 @@
// specific language governing permissions and limitations
// under the License.
-plugins {
- id "me.champeau.gradle.jmh" version "0.5.0"
-}
-
apply from: "$rootDir/gradle/protobuf.gradle"
apply from: "$rootDir/gradle/shadow.gradle"
+apply from: "$rootDir/gradle/benchmarks.gradle"
dependencies {
// Not shaded in the client JAR because it's part of the public API.
@@ -49,9 +46,6 @@ dependencies {
testCompile libs.log4j
testCompile libs.log4jSlf4jImpl
testCompile libs.mockitoCore
-
- jmh 'org.openjdk.jmh:jmh-core:1.23'
- jmh 'org.openjdk.jmh:jmh-generator-annprocess:1.23'
}
// Add protobuf files to the proto source set.
@@ -64,8 +58,3 @@ sourceSets {
}
}
}
-
-jmh {
- duplicateClassesStrategy = 'exclude'
- zip64 = true
-}
\ No newline at end of file