You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2020/06/02 11:50:06 UTC

[lucene-solr] branch master updated: LUCENE-9382: update gradle to 6.4.1. (#1549)

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

dweiss pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e8e5d8  LUCENE-9382: update gradle to 6.4.1. (#1549)
3e8e5d8 is described below

commit 3e8e5d8cf6477a60cd8019a41c657bcf313a174c
Author: Dawid Weiss <dw...@apache.org>
AuthorDate: Tue Jun 2 13:49:57 2020 +0200

    LUCENE-9382: update gradle to 6.4.1. (#1549)
    
    * LUCENE-9382: update gradle to 6.4.1. Requires minor changes around log call validation by restructuring the code around switches to a series of ifs. Piggybacking: apply log validation to :solr modules. Add inputs declaration so that task is not re-run on unmodified files.
---
 gradle/validation/check-environment.gradle  |   2 +-
 gradle/validation/validate-log-calls.gradle |  41 ++++++++++++++++------------
 gradle/wrapper/gradle-wrapper.jar           | Bin 58702 -> 58910 bytes
 gradle/wrapper/gradle-wrapper.jar.sha256    |   2 +-
 gradle/wrapper/gradle-wrapper.jar.version   |   2 +-
 gradle/wrapper/gradle-wrapper.properties    |   2 +-
 6 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/gradle/validation/check-environment.gradle b/gradle/validation/check-environment.gradle
index 8d83e04..0f3a084 100644
--- a/gradle/validation/check-environment.gradle
+++ b/gradle/validation/check-environment.gradle
@@ -22,7 +22,7 @@ import org.gradle.util.GradleVersion
 
 configure(rootProject) {
   ext {
-    expectedGradleVersion = '6.0.1'
+    expectedGradleVersion = '6.4.1'
     minJavaVersion = JavaVersion.VERSION_11
   }
 
diff --git a/gradle/validation/validate-log-calls.gradle b/gradle/validation/validate-log-calls.gradle
index a81fd3b..76fee5a 100644
--- a/gradle/validation/validate-log-calls.gradle
+++ b/gradle/validation/validate-log-calls.gradle
@@ -34,11 +34,13 @@ import org.apache.tools.ant.BuildException
 
 // See the associated help task "gradlew helpValidateLogCalls"
 
-allprojects {
+configure(subprojects.findAll { it.path.startsWith(':solr') }) {
   plugins.withType(JavaPlugin) {
     task validateLogCalls(type: ValidateLogCallsTask) {
       description "Checks that log calls are either validated or conform to efficient patterns."
       group "verification"
+
+      sourceFiles = files(sourceSets*.java)
     }
   }
 }
@@ -53,6 +55,7 @@ class ValidateLogCallsTask extends DefaultTask {
     violations.add(System.lineSeparator + msg);
     errsFound++;
   }
+
   // We have a log.something line, check for patterns we're not fond of.
   def checkLine(File file, String line, int lineNumber, String previous) {
     boolean violation = false
@@ -204,31 +207,35 @@ class ValidateLogCallsTask extends DefaultTask {
           reportViolation("Bad state, should be 0-1 in the switch statement") // make people aware the code sucks
           break
       }
-      switch (state) { // It's just easier to do this here rather than read another line in the switch above.
-        case 0: // Not collcting a log line
+
+      // It's just easier to do this here rather than read another line in the switch above.
+      if (state == 0) {
+          // Not collecting a log line
           prevLine = line.toLowerCase();
-          break;
-        case 1: // collecting a logging line.
-          break;
-        case 2: // We've collected the complete log line.
+      } else if (state == 1) {
+          // collecting a logging line.
+      } else if (state == 2) {
+          // We've collected the complete log line.
           checkLine(file, sb.toString(), lineNumber, prevLine)
           state = 0
-          break;
-        default:
-          break;
+      } else {
+          assert false
       }
     }
-    return
+  }
+
+  @InputFiles
+  FileCollection sourceFiles
+
+  ValidateLogCallsTask() {
+    // No explicit outputs (outputs always up to date).
+    outputs.upToDateWhen { true }
   }
 
   @TaskAction
   def checkLogLines() {
-
-    project.sourceSets.each { srcSet ->
-      srcSet.java.each { f ->
-        checkFile(f)
-      }
-    }
+    sourceFiles.each { checkFile(it) }
+    logger.warn("Checked: ${sourceFiles.files.size()}")
 
     if (errsFound > 0) {
       throw new BuildException(String.format(Locale.ENGLISH, 'Found %d violations in source files (%s).',
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index cc4fdc2..62d4c05 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.jar.sha256 b/gradle/wrapper/gradle-wrapper.jar.sha256
index a9b144f..f315f8d 100644
--- a/gradle/wrapper/gradle-wrapper.jar.sha256
+++ b/gradle/wrapper/gradle-wrapper.jar.sha256
@@ -1 +1 @@
-28b330c20a9a73881dfe9702df78d4d78bf72368e8906c70080ab6932462fe9e
\ No newline at end of file
+70239e6ca1f0d5e3b2808ef6d82390cf9ad58d3a3a0d271677a51d1b89475857
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar.version b/gradle/wrapper/gradle-wrapper.jar.version
index 6d54bbd..306894a 100644
--- a/gradle/wrapper/gradle-wrapper.jar.version
+++ b/gradle/wrapper/gradle-wrapper.jar.version
@@ -1 +1 @@
-6.0.1
\ No newline at end of file
+6.4.1
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1ba7206..21e622d 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists