You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2021/01/18 04:48:10 UTC

[kudu] branch master updated (1dc7c83 -> 55b10e8)

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git.


    from 1dc7c83  KUDU-2612 Java client transaction API
     new 2a02629  [build] Separate protobuf java compilation into a seperate module
     new 55b10e8  [build] Add a test coverage report to the Java build

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build-support/check_compatibility.py               |  1 +
 java/build.gradle                                  |  1 +
 java/buildSrc/build.gradle                         |  1 +
 java/gradle/dependencies.gradle                    |  1 +
 java/gradle/quality.gradle                         | 19 +++++++++++++
 java/kudu-client/build.gradle                      | 14 +---------
 .../hash.proto => java/kudu-proto/build.gradle     | 32 ++++++++++++++++------
 java/kudu-subprocess/build.gradle                  | 14 +---------
 java/settings.gradle                               |  1 +
 9 files changed, 49 insertions(+), 35 deletions(-)
 copy src/kudu/util/hash.proto => java/kudu-proto/build.gradle (63%)


[kudu] 02/02: [build] Add a test coverage report to the Java build

Posted by gr...@apache.org.
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

commit 55b10e82a62c21c6d9162f41483b956f28528d07
Author: Grant Henke <gr...@apache.org>
AuthorDate: Tue May 8 13:55:10 2018 -0500

    [build] Add a test coverage report to the Java build
    
    This patch adds a jacoco test coverage report to the Java build.
    The report can be generated by running
    `./gradlew jacocoAggregatedReport` and looking at
    `java/build/reports/jacoco/jacocoAggregatedReport/html/index.html`
    
    A follow on patch will add this coverage run to the build-and-test.sh
    “COVERAGE” type build.
    
    Change-Id: I0f2a2b1836b5ade72a757a8d7e2c518858ec48bb
    Reviewed-on: http://gerrit.cloudera.org:8080/16954
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 java/build.gradle               |  1 +
 java/buildSrc/build.gradle      |  1 +
 java/gradle/dependencies.gradle |  1 +
 java/gradle/quality.gradle      | 19 +++++++++++++++++++
 4 files changed, 22 insertions(+)

diff --git a/java/build.gradle b/java/build.gradle
index 7514176..686a5d5 100755
--- a/java/build.gradle
+++ b/java/build.gradle
@@ -25,6 +25,7 @@ import org.apache.kudu.gradle.DistTestTask
 // Plugins and scripts applied at the root level only, instead of per module.
 apply plugin: "idea"
 apply plugin: "eclipse"
+apply plugin: "org.barfuin.gradle.jacocolog"
 apply from: "$rootDir/gradle/properties.gradle"
 apply from: "$rootDir/gradle/dependencies.gradle"
 apply from: "$rootDir/gradle/wrapper.gradle"
diff --git a/java/buildSrc/build.gradle b/java/buildSrc/build.gradle
index e9d9b7c..840a936 100644
--- a/java/buildSrc/build.gradle
+++ b/java/buildSrc/build.gradle
@@ -30,6 +30,7 @@ repositories {
 dependencies {
   compile "com.github.ben-manes:gradle-versions-plugin:0.36.0"
   compile "com.github.jengelman.gradle.plugins:shadow:6.1.0"
+  compile "gradle.plugin.org.barfuin.gradle.jacocolog:gradle-jacoco-log:1.2.3"
   compile "gradle.plugin.com.google.gradle:osdetector-gradle-plugin:1.6.2"
   compile "com.google.protobuf:protobuf-gradle-plugin:0.8.14"
   compile "com.netflix.nebula:nebula-clojure-plugin:9.4.3"
diff --git a/java/gradle/dependencies.gradle b/java/gradle/dependencies.gradle
index 911c5e9..10aef8b 100755
--- a/java/gradle/dependencies.gradle
+++ b/java/gradle/dependencies.gradle
@@ -40,6 +40,7 @@ versions += [
     hdrhistogram   : "2.1.12",
     hive           : "3.1.2",
     httpClient     : "4.5.13",
+    jacoco         : "0.8.6",
     jepsen         : "0.1.5",
     jetty          : "9.4.35.v20201120",
     jmh            : "1.27",
diff --git a/java/gradle/quality.gradle b/java/gradle/quality.gradle
index 69d3759..f4ca7a8 100644
--- a/java/gradle/quality.gradle
+++ b/java/gradle/quality.gradle
@@ -101,6 +101,25 @@ if(!JavaVersion.current().isJava12Compatible()) {
   }
 }
 
+// Don't enable code coverage for kudu-proto given it is exclusively generated code.
+// Don't enable code coverage for kudu-jepsen given it is exclusively test code.
+if (project.name != "kudu-proto" && project.name != "kudu-jepsen") {
+  apply plugin: "jacoco" // Provides code coverage metrics for Java code.
+  jacoco {
+    toolVersion = versions.jacoco
+  }
+  tasks.withType(JacocoReport) {
+    reports {
+      csv.enabled false
+      xml.enabled true
+      html.enabled true
+    }
+  }
+  jacocoTestReport {
+    dependsOn test // tests are required to run before generating the report
+  }
+}
+
 // Define a Java API signature for use by animal-sniffer. It'll enforce that all
 // Java API usage adheres to this signature.
 dependencies {


[kudu] 01/02: [build] Separate protobuf java compilation into a seperate module

Posted by gr...@apache.org.
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

commit 2a02629d8a2f06fbb063b57b0a539dd7cc9c02c8
Author: Grant Henke <gr...@apache.org>
AuthorDate: Thu Jan 14 12:38:31 2021 -0600

    [build] Separate protobuf java compilation into a seperate module
    
    Currently we compile the protobufs in both the kudu-client
    and the kudu-subprocess. Doing this also combines them onto
    the same classpath as the module itself.
    
    This patch breaks those classes into a separate `kudu-proto`
    module so that we can avoid duplicate work and ignore
    the `kudu-proto` module in API compatibility and test
    coverage checks.
    
    This module is not published, so there is no net change to the final
    artifacts.
    
    Change-Id: Ib83db74c4a09cdd597bee90f5124ed804adac42d
    Reviewed-on: http://gerrit.cloudera.org:8080/16953
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
 build-support/check_compatibility.py              |  1 +
 java/kudu-client/build.gradle                     | 14 +-------
 java/{settings.gradle => kudu-proto/build.gradle} | 39 ++++++++++++++---------
 java/kudu-subprocess/build.gradle                 | 14 +-------
 java/settings.gradle                              |  1 +
 5 files changed, 28 insertions(+), 41 deletions(-)

diff --git a/build-support/check_compatibility.py b/build-support/check_compatibility.py
index 52e82b4..24762cc 100755
--- a/build-support/check_compatibility.py
+++ b/build-support/check_compatibility.py
@@ -132,6 +132,7 @@ def find_client_jars(path):
       "kudu-backup" not in j and
       "kudu-hive" not in j and
       "kudu-jepsen" not in j and
+      "kudu-proto" not in j and
       "kudu-subprocess" not in j)]
 
 
diff --git a/java/kudu-client/build.gradle b/java/kudu-client/build.gradle
index 8e655ff..082b7d9 100644
--- a/java/kudu-client/build.gradle
+++ b/java/kudu-client/build.gradle
@@ -15,11 +15,11 @@
 // specific language governing permissions and limitations
 // under the License.
 
-apply from: "$rootDir/gradle/protobuf.gradle"
 apply from: "$rootDir/gradle/shadow.gradle"
 apply from: "$rootDir/gradle/benchmarks.gradle"
 
 dependencies {
+  compile project(path: ":kudu-proto")
   // Not shaded in the client JAR because it's part of the public API.
   compileUnshaded(libs.async) {
     // async uses versions ranges for slf4j making builds non-deterministic.
@@ -32,7 +32,6 @@ dependencies {
   compile libs.micrometerCore
   compile libs.murmur
   compile libs.netty
-  compile libs.protobufJava
 
   optional libs.jsr305
   optional libs.yetusAnnotations
@@ -44,14 +43,3 @@ dependencies {
   testCompile libs.log4jSlf4jImpl
   testCompile libs.mockitoCore
 }
-
-// Add protobuf files to the proto source set.
-sourceSets {
-  main {
-    proto {
-      srcDir "${project.rootDir}/../src"
-      // Excluded any test proto files
-      exclude "**/*test*.proto"
-    }
-  }
-}
diff --git a/java/settings.gradle b/java/kudu-proto/build.gradle
similarity index 61%
copy from java/settings.gradle
copy to java/kudu-proto/build.gradle
index a6c3355..c32cad4 100644
--- a/java/settings.gradle
+++ b/java/kudu-proto/build.gradle
@@ -15,19 +15,28 @@
 // specific language governing permissions and limitations
 // under the License.
 
-// This file contains the configuration of the project hierarchy.
-// Mainly we just define what subprojects are in the build.
+apply from: "$rootDir/gradle/protobuf.gradle"
 
-rootProject.name = "kudu-parent"
-include "kudu-backup"
-include "kudu-backup-common"
-include "kudu-backup-tools"
-include "kudu-client"
-include "kudu-client-tools"
-include "kudu-hive"
-include "kudu-jepsen"
-include "kudu-mapreduce"
-include "kudu-spark"
-include "kudu-spark-tools"
-include "kudu-subprocess"
-include "kudu-test-utils"
+dependencies {
+  compile libs.protobufJava
+}
+
+// Add protobuf files to the proto source set.
+sourceSets {
+  main {
+    proto {
+      srcDir "${project.rootDir}/../src"
+      // Excluded any test proto files
+      exclude "**/*test*.proto"
+    }
+  }
+}
+
+// kudu-proto has no public Javadoc.
+javadoc {
+  enabled = false
+}
+
+// Skip publishing kudu-proto artifact because it will always be shaded into kudu-client.
+uploadArchives.enabled = false
+install.enabled = false
diff --git a/java/kudu-subprocess/build.gradle b/java/kudu-subprocess/build.gradle
index 45360aa..bef4ead 100644
--- a/java/kudu-subprocess/build.gradle
+++ b/java/kudu-subprocess/build.gradle
@@ -15,13 +15,13 @@
 // specific language governing permissions and limitations
 // under the License.
 
-apply from: "$rootDir/gradle/protobuf.gradle"
 apply from: "$rootDir/gradle/shadow.gradle"
 
 // Explicitly allow slf4j to be included in this jar.
 shadowIncludeSlf4j = true
 
 dependencies {
+  compile project(path: ":kudu-proto")
   compile(libs.hadoopCommon) {
     // hadoopCommon and rangerPlugin use different versions of jersey.
     exclude group: "com.sun.jersey"
@@ -29,7 +29,6 @@ dependencies {
     exclude group: "log4j"
     exclude group: "org.slf4j"
   }
-  compile libs.protobufJava
   compile libs.protobufJavaUtil
 
   compile(libs.rangerPlugin) {
@@ -54,17 +53,6 @@ dependencies {
   testCompile libs.mockitoCore
 }
 
-// Add protobuf files to the proto source set.
-sourceSets {
-  main {
-    proto {
-      srcDir "${project.rootDir}/../src"
-      // Excluded any test proto files
-      exclude "**/*test*.proto"
-    }
-  }
-}
-
 // kudu-subprocess has no public Javadoc.
 javadoc {
   enabled = false
diff --git a/java/settings.gradle b/java/settings.gradle
index a6c3355..0fd3ebc 100644
--- a/java/settings.gradle
+++ b/java/settings.gradle
@@ -27,6 +27,7 @@ include "kudu-client-tools"
 include "kudu-hive"
 include "kudu-jepsen"
 include "kudu-mapreduce"
+include "kudu-proto"
 include "kudu-spark"
 include "kudu-spark-tools"
 include "kudu-subprocess"