From b046c1d4cb6e70ad9c6d201dda8f8448c144e401 Mon Sep 17 00:00:00 2001 From: Achal Talati Date: Thu, 25 Jan 2024 15:20:46 +0530 Subject: [PATCH] added support for gradle 8.5 Signed-off-by: Achal Talati --- build.xml | 2 +- patches/6807.diff | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 patches/6807.diff diff --git a/build.xml b/build.xml index 0459437..85f8268 100644 --- a/build.xml +++ b/build.xml @@ -31,7 +31,7 @@ - + diff --git a/patches/6807.diff b/patches/6807.diff new file mode 100644 index 0000000..c587349 --- /dev/null +++ b/patches/6807.diff @@ -0,0 +1,37 @@ +diff --git a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java +index 1cc156d0f622..c90316077493 100644 +--- a/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java ++++ b/extide/gradle/src/org/netbeans/modules/gradle/api/execute/GradleDistributionManager.java +@@ -100,6 +100,7 @@ public final class GradleDistributionManager { + GradleVersion.version("7.5"), // JDK-18 + GradleVersion.version("7.6"), // JDK-19 + GradleVersion.version("8.3"), // JDK-20 ++ GradleVersion.version("8.5"), // JDK-21 + }; + + final File gradleUserHome; +@@ -484,12 +485,22 @@ public String getVersion() { + * Checks if this Gradle distribution is compatible with the given + * major version of Java. Java 1.6, 1.7 and 1.8 are treated as major + * version 6, 7, and 8. +- * ++ *

++ * NetBeans uses a built in fixed list of compatibility matrix. That ++ * means it might not know about the compatibility of newer Gradle ++ * versions. Optimistic bias would return {@code true} on these ++ * versions form 2.37. ++ *

+ * @param jdkMajorVersion the major version of the JDK + * @return true if this version is supported with that JDK. + */ + public boolean isCompatibleWithJava(int jdkMajorVersion) { +- return jdkMajorVersion <= lastSupportedJava(); ++ ++ GradleVersion lastKnown = JDK_COMPAT[JDK_COMPAT.length - 1]; ++ // Optimistic bias, if the GradleVersion is newer than the last NB ++ // knows, we say it's compatible with any JDK ++ return lastKnown.compareTo(version.getBaseVersion()) < 0 ++ || jdkMajorVersion <= lastSupportedJava(); + } + + /**