JaroslavTulach commented on a change in pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#discussion_r550952272
##########
File path: extide/gradle/src/org/netbeans/modules/gradle/api/GradleProjects.java
##########
@@ -88,6 +93,36 @@ public static File getJavadoc(File binary) {
return Collections.unmodifiableMap(ret);
}
+ /**
+ * Returns the NetBeans project representation of the given Gradle project.
+ * If the given project is not a Gradle project it returns
<code>null</code>,
+ * otherwise returns the Project which is assigned for the given project
+ * root directory.
+ *
+ * @param project the project to determine of its root.
+ *
+ * @return the root project or <code>null</code> if the given project is
not
+ * a Gradle project.
+ * @since 2.7
+ */
+ public static Project rootOf(Project project) {
Review comment:
It might be more useful to return `project` if no parent/root project is
known. Especially if:
This might be a useful concept in generic Project API. There already is
[SubprojectProvider](https://bits.netbeans.org/12.0/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/SubprojectProvider.html)
and
[ProjectContainerProvider](https://bits.netbeans.org/12.0/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/ProjectContainerProvider.html).
There could be `ParentProvider` and/or `RootProjectProvider` and the `rootOf`
method could be moved to
[ProjectUtils](https://bits.netbeans.org/12.0/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/ProjectUtils.html).
Then it could/should be implemented by Maven as well.
I can imagine a "Build All" action that would build the root project to make
sure all bits are compiled and then continue with some other operation.
----------------------------------------------------------------
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.
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