wrprice commented on code in PR #8797:
URL: https://github.com/apache/netbeans/pull/8797#discussion_r2328889597


##########
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:
   Gradle >= 8.11 but <9 should have both APIs



-- 
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

Reply via email to