generated from oracle/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added support for gradle 8.5 #108
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
- * | ||
+ * <p> | ||
+ * 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. | ||
+ * </p> | ||
* @param jdkMajorVersion the major version of the JDK | ||
* @return <code>true</code> 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(); | ||
} | ||
|
||
/** |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make use of Gradle compatibility table given here https://docs.gradle.org/current/userguide/compatibility.html ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes maybe I don't know for sure, but currently it is manually handled in netbeans for every release. This patch is taken from apache/netbeans#6807