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

uschindler pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new a793d13  SOLR-15876: Fix errror prone on JDK 16 or later (disable). 
This reverts parts of #477
a793d13 is described below

commit a793d13be5f04ed1e827f62465b414e07c59692c
Author: Uwe Schindler <[email protected]>
AuthorDate: Thu Jan 6 17:53:18 2022 +0100

    SOLR-15876: Fix errror prone on JDK 16 or later (disable). This reverts 
parts of #477
---
 gradle/validation/error-prone.gradle | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gradle/validation/error-prone.gradle 
b/gradle/validation/error-prone.gradle
index 098f7bf..1d55d9f 100644
--- a/gradle/validation/error-prone.gradle
+++ b/gradle/validation/error-prone.gradle
@@ -15,11 +15,31 @@
  * limitations under the License.
  */
 
+def skipErrorProne = rootProject.runtimeJavaVersion > JavaVersion.VERSION_15;
+if (skipErrorProne) {
+  configure(rootProject) {
+    task errorProneSkipped() {
+      doFirst {
+        logger.warn("WARNING: errorprone disabled (won't work with JDK 
${rootProject.runtimeJavaVersion})")
+      }
+    }
+  }
+}
+
 allprojects { prj ->
   plugins.withType(JavaPlugin) {
     // LUCENE-9650: Errorprone on master/gradle does not work with JDK-16+
     // this is a hack to keep the dependency (so that palantir's version check 
doesn't complain)
     // but don't include the plugin (which fails on JDK16+).
+    if (skipErrorProne) {
+      tasks.withType(JavaCompile) { task -> task.dependsOn 
":errorProneSkipped" }
+      configurations {
+        errorprone
+      }
+      dependencies {
+        errorprone("com.google.errorprone:error_prone_core")
+      }
+    } else {
       prj.apply plugin: 'net.ltgt.errorprone'
 
       dependencies {
@@ -129,6 +149,7 @@ allprojects { prj ->
             '-Xep:UnusedVariable:OFF',
             '-Xep:WaitNotInLoop:OFF',
         ]
+      }
     }
   }
 }

Reply via email to