This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 11e2814 SOLR-15876: Fix errror prone on JDK 16 or later (disable).
This reverts parts of #477
11e2814 is described below
commit 11e2814ec0754b893f112231cdd160fb04365e4e
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',
]
+ }
}
}
}