wrprice commented on code in PR #8797:
URL: https://github.com/apache/netbeans/pull/8797#discussion_r2335402124
##########
extide/gradle/netbeans-gradle-tooling/src/main/java/org/netbeans/modules/gradle/tooling/NbProjectInfoBuilder.java:
##########
@@ -1562,6 +1563,23 @@ private void detectDependencies(NbProjectInfoModel
model) {
boolean ignoreUnresolvable =
(project.getPlugins().hasPlugin("java-platform") &&
Boolean.TRUE.equals(getProperty(project, "javaPlatform",
"allowDependencies")));
+ // https://github.com/apache/netbeans/issues/8764
+ Function<ProjectDependency, Project> projDependencyToProject =
+ sinceGradleOrDefault(
+ "9.0",
+ () -> {
+ Method getPath =
ProjectDependency.class.getMethod("getPath");
+ return dep -> {
+ try {
+ String path = (String) getPath.invoke(dep);
+ return project.findProject(path);
+ } catch (ReflectiveOperationException e) {
+ throw new UnsupportedOperationException(e);
+ }
+ };
+ },
+ () -> ProjectDependency::getDependencyProject); // removed in
Gradle 9
Review Comment:
I have an alternative branch where I think I've done the necessary work to
bump this module up to Gradle 8.11.1. Tested locally on some personal Gradle
projects using 7.5.x, 8.11-14, and 9.0.0 and they all open w/out error
notifications. In the process there was a fun roadbump that turns out to be a
JDK bug re: method references under certain conditions.
The 8.11.1 upgrade has several more required changes compared to this spot
fix. LMK how you'd like me to proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists