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

alexey 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 91cb9da22 [build-and-test] run 'gradle clean' before building Java
91cb9da22 is described below

commit 91cb9da22c9437db2e8b4b0f2793aca081afddc1
Author: Alexey Serbin <ale...@apache.org>
AuthorDate: Thu Nov 28 20:54:43 2024 -0800

    [build-and-test] run 'gradle clean' before building Java
    
    When updating Java dependencies in changelists [1] and [2], I noticed
    that pre-commit builds were failing fail because the copyDistTestJars
    task wouldn't copy all the necessary JARs to into the staging directory
    for dist-test since gradle would assume the target is up-to-date.
    I think that was due to the fact that the same workspace was re-used
    between different builds, and no 'clean' task was run.
    
    This changelist is to address the issue.  To avoid incurring the penalty
    of rebuilding Java bits from scratch, this patch enables gradle's build
    cache. As per [3], this is exactly the use-case to benefit from gradle's
    caching.  In addition, this patch re-enables parallel builds as well.
    
    [1] https://github.com/apache/kudu/commit/b009144cd
    [2] https://github.com/apache/kudu/commit/150ec7ff5
    [3] https://docs.gradle.org/current/userguide/part6_gradle_caching.html
    
    Change-Id: Ief3d2f07dfcf8746aa69f870c319599c92e098dc
    Reviewed-on: http://gerrit.cloudera.org:8080/22144
    Tested-by: Alexey Serbin <ale...@apache.org>
    Reviewed-by: Abhishek Chennaka <achenn...@cloudera.com>
---
 build-support/jenkins/build-and-test.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/build-support/jenkins/build-and-test.sh 
b/build-support/jenkins/build-and-test.sh
index eb923d467..647275015 100755
--- a/build-support/jenkins/build-and-test.sh
+++ b/build-support/jenkins/build-and-test.sh
@@ -345,8 +345,7 @@ fi
 export EXTRA_GRADLE_FLAGS="--console=plain"
 EXTRA_GRADLE_FLAGS="$EXTRA_GRADLE_FLAGS --no-daemon"
 EXTRA_GRADLE_FLAGS="$EXTRA_GRADLE_FLAGS --continue"
-# Temporarily disable parallel builds for automated builds.
-EXTRA_GRADLE_FLAGS="$EXTRA_GRADLE_FLAGS --no-parallel"
+EXTRA_GRADLE_FLAGS="$EXTRA_GRADLE_FLAGS --build-cache"
 # KUDU-2524: temporarily disable scalafmt until we can work out its JDK
 # incompatibility issue.
 EXTRA_GRADLE_FLAGS="$EXTRA_GRADLE_FLAGS -DskipFormat"
@@ -546,6 +545,10 @@ if [ "$BUILD_JAVA" == "1" ]; then
   # Run the full Gradle build.
   # If we're running distributed Java tests, submit them asynchronously.
   if [ "$ENABLE_DIST_TEST" == "1" ]; then
+    if ! ./gradlew $EXTRA_GRADLE_FLAGS clean assemble; then
+      TESTS_FAILED=1
+      FAILURES="$FAILURES"$'Java Gradle build failed\n'
+    fi
     echo
     echo Submitting Java distributed-test job.
     echo ------------------------------------------------------------

Reply via email to