You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/01/01 05:34:18 UTC

[GitHub] [netbeans] lkishalmi opened a new pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

lkishalmi opened a new pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629


   It also shall fix some non-resolvable configuration processing, though that needs to be experimented further.
   Also the documentation of the new API function is not ready yet...


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] pekuz commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
pekuz commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800154920


   There is a strange asymmetry in the provider interfaces: 
     - get parent can return null 
     - get root can not return null 
     
   Assuming a root should be reachable by traversing parents chain then allowing the null in the parents chain but not allowing the null for the root itself smells.
     


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic edited a comment on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
sdedic edited a comment on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800211528


   @pekuz Well, that's a question: for `root` project, returning self makes perfect sense. From each project, one hop through `RootProjectProvider` leads to the root, whatever it is. In a tree-like structure, it's quite common (IMHO) that a parent is null for the tree root.
   
   To make developer's life easier, there could be e.g. `ProjectUtils.projectContainment` that could return the whole sequence including self = never empty.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on a change in pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on a change in pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#discussion_r550958303



##########
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:
       That's a good idea, I could implement that as well.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#discussion_r593308301



##########
File path: ide/projectapi/apichanges.xml
##########
@@ -83,6 +83,23 @@ is the proper place.
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
+        <change id="parent-and-root-project-provider">
+            <api name="general"/>
+            <summary>Added <code>ParentProjectProvider</code> and <code>RootProjectProvider</code> to improve project hierarchy discovery</summary>
+            <version major="1" minor="79"/>
+            <date day="2" month="1" year="2021"/>
+            <author login="lkishalmi"/>
+            <compatibility addition="yes"/>
+            <description>
+                <p>
+                    <code><a href="@TOP@/org/netbeans/spi/project/ParentProjectProvider.html">ParentProjectProvider</a></code> and
+                    <code><a href="@TOP@/org/netbeans/spi/project/RootProjectProvider.html">RootProjectProvider</a></code> with correspondig
+                    utility methods in <code><a href="@TOP@/org/netbeans/api/project/ProjectUtils.html">RootProjectProvider</a></code>

Review comment:
       Here is a typo. The utility method is in `ProjectUtils`! CCing @sdedic 




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800211528


   Well, that's a question: for `root` project, returning self makes perfect sense. From each project, one hop through `RootProjectProvider` leads to the root, whatever it is. In a tree-like structure, it's quite common (IMHO) that a parent is null. 
   
   To make developer's life easier, there could be e.g. `ProjectUtils.projectContainment` that could return the whole sequence including self = never empty.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800286378


   I guess the interface will need some love anyway, we have released it with nice typo right in the method's name :)


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi merged pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
lkishalmi merged pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-799466491


   I filed [NETBEANS-5455](https://issues.apache.org/jira/browse/NETBEANS-5455) for myself; I think I need a clarification on what the API introduced in this PR means -- how to properly transpose it into Maven world. Pls. comment in NETBEANS-5455.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi merged pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
lkishalmi merged pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] pekuz commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
pekuz commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800222137


   Then parent provider interface JavaDoc:
   
        The immediate parent of this project or <code>null</code> if there is no parent known.
   
   could become:
   
        The immediate parent of this project or <code>null</code> if this project is the root.
   
   no?
   
   Originally I got it like null stays for unknown, e.g. because of incomplete source tree. 


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-753261307


   ![image](https://user-images.githubusercontent.com/1381701/103434020-fa8f7e00-4baf-11eb-9701-7e40499659a6.png)
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-753650232


   So there is two new interfaces in the Project API ```RootProjectProvider``` and ```ParentProjectProvider```. I'm not sure if I shall have added change listener registration methods to them. I'd trust @JaroslavTulach experience on that matter, so if you see it would be wise to include those, I'd do that.
   It is a bit unfortunate that this PR and the commit is entangled with two changes. If really required I could split those into two PR-s.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] sdedic edited a comment on pull request #2629: [NETBEANS-5204] New Gradle Sub-project handling

Posted by GitBox <gi...@apache.org>.
sdedic edited a comment on pull request #2629:
URL: https://github.com/apache/netbeans/pull/2629#issuecomment-800211528


   @pekuz Well, that's a question: for `root` project, returning self makes perfect sense. From each project, one hop through `RootProjectProvider` leads to the root, whatever it is. In a tree-like structure, it's quite common (IMHO) that a parent is null. 
   
   To make developer's life easier, there could be e.g. `ProjectUtils.projectContainment` that could return the whole sequence including self = never empty.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists