mbien commented on code in PR #8797:
URL: https://github.com/apache/netbeans/pull/8797#discussion_r2335455449
##########
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:
@wrprice sounds great! We could try to get this PR here in first, then see
if we can bump the tooling version.
Last time I tried I could get a hello world project using gradle 5.x to
build, but I believe 4 didn't work anymore. But I personally don't use gradle
all that much, I let others comment on the versions question. NB generally
tries to support lower versions if it is still reasonably maintainable while
keeping up with latest releases.
> The 8.11.1 upgrade has several more required changes compared to this spot
fix. LMK how you'd like me to proceed.
Once this PR here is merged, we could certainly take a look at the version
bump proposal, unless there is a showstopper I am not aware of (cc @lkishalmi )
--
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