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 8a6faaa [java] Add useBinJar Gradle property
8a6faaa is described below
commit 8a6faaa93f3e206ac75e8087731daccaf7ab646a
Author: Grant Henke <[email protected]>
AuthorDate: Tue Apr 30 14:29:37 2019 -0500
[java] Add useBinJar Gradle property
Adds support for running the Java Gradle tests against
an arbitrary version of the kudu-binary jar.
Passing `-PuseBinJar=<version>` will use the specified
kudu-binary jar when running tests, otherwise the
default behavior, using the local Kudu binaries, is used.
Change-Id: Ia87217cee288c5d4a4085c2f59ec6e9e92e7c87a
Reviewed-on: http://gerrit.cloudera.org:8080/13195
Reviewed-by: Brian McDevitt <[email protected]>
Tested-by: Grant Henke <[email protected]>
Reviewed-by: Adar Dembo <[email protected]>
Reviewed-by: Mike Percy <[email protected]>
---
java/buildSrc/build.gradle | 3 ++-
java/gradle/tests.gradle | 7 +++++--
java/kudu-test-utils/build.gradle | 7 +++++++
3 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/java/buildSrc/build.gradle b/java/buildSrc/build.gradle
index 9229556..e0dc190 100644
--- a/java/buildSrc/build.gradle
+++ b/java/buildSrc/build.gradle
@@ -31,13 +31,14 @@ dependencies {
compile "com.commercehub.gradle.plugin:gradle-avro-plugin:0.16.0"
compile "com.github.ben-manes:gradle-versions-plugin:0.21.0"
compile "com.github.jengelman.gradle.plugins:shadow:5.0.0"
+ compile "gradle.plugin.com.google.gradle:osdetector-gradle-plugin:1.6.2"
compile "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
compile "com.netflix.nebula:nebula-clojure-plugin:8.1.1"
compile "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:1.7.0"
compile "io.spring.gradle:propdeps-plugin:0.0.9.RELEASE"
compile "net.ltgt.gradle:gradle-errorprone-plugin:0.7.1"
compile "ru.vyarus:gradle-animalsniffer-plugin:1.5.0"
- compile 'com.google.code.gson:gson:2.8.5'
+ compile "com.google.code.gson:gson:2.8.5"
compile "cz.alenkacz:gradle-scalafmt:1.7.2"
}
diff --git a/java/gradle/tests.gradle b/java/gradle/tests.gradle
index 2b541c4..94a0d49 100644
--- a/java/gradle/tests.gradle
+++ b/java/gradle/tests.gradle
@@ -62,8 +62,11 @@ tasks.withType(Test) {
systemProperty "java.net.preferIPv4Stack", true
systemProperty "java.security.egd", "file:/dev/urandom" // Improve RNG
generation speed.
- // Set kuduBinDir to the binaries to use with the MiniKuduCluster.
- systemProperty "kuduBinDir", propertyWithDefault("kuduBinDir",
"$project.rootDir/../build/latest/bin")
+ // Only use the local KuduBinDir if we are not using the kudu-binary jar.
+ if (!propertyExists("useBinJar")) {
+ // Set kuduBinDir to the binaries to use with the MiniKuduCluster.
+ systemProperty "kuduBinDir", propertyWithDefault("kuduBinDir",
"$project.rootDir/../build/latest/bin")
+ }
// Set testRandomSeed to override the seed for the PRNG exposed in
// RandomUtils.java and used by various tests. This is useful when trying to
diff --git a/java/kudu-test-utils/build.gradle
b/java/kudu-test-utils/build.gradle
index 9db3651..fbd8323 100644
--- a/java/kudu-test-utils/build.gradle
+++ b/java/kudu-test-utils/build.gradle
@@ -28,6 +28,13 @@ dependencies {
compileUnshaded libs.junit
compileUnshaded libs.slf4jApi
+ // Support using any kudu-binary jar for tests via `-PuseBinJar=<version>`.
+ if (propertyExists("useBinJar")) {
+ apply plugin: "com.google.osdetector"
+ def jarVersion = propertyWithDefault("useBinJar", project.version)
+ runtime "org.apache.kudu:kudu-binary:$jarVersion:${osdetector.classifier}"
+ }
+
// Needed for CapturingLogAppender. Optional otherwise.
optional libs.log4j
optional libs.slf4jLog4j12