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 2022/08/12 10:19:46 UTC

[GitHub] [netbeans] sdedic opened a new pull request, #4499: Initial implementation of (experimental) Dependency API in Gradle

sdedic opened a new pull request, #4499:
URL: https://github.com/apache/netbeans/pull/4499

   Dependency tree is exported from Gradle, using *still nonpublic* `project.dependency` API. I admit I need it functioning for the NBLS server, so I propose to go short-term with **implementation** dependency on `project.dependency` module. I plan to stabilize and publish the project.dependency as a regular API in NB16 timeframe with `ProjectArtifactsQuery` that exposes project output artifact(s) for further analysis or processing.  I hope I will be able to adapt Maven Graph module to serve for both Maven and Gradle connecting using the new APIs.
   
   Part of this commit is an adjustment to the OCI enterprise feature so it is able to exploit this new Gradle ability to serve dependency tree. During testing it seems that an initial dependency graph of 100 nodes would explode to 10.000+ nodes when converted to a proper tree, so the Dependency API will receive some tweak to allow implementations to compute the nodes lazily and to indicate to the client that two nodes are truly equivalent. In the meantime, I've changed the ADM feature to send a graph instead of tree - it appears working.
   
   Minor fix to Maven implementation.
   


-- 
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: notifications-unsubscribe@netbeans.apache.org

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 merged pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
sdedic merged PR #4499:
URL: https://github.com/apache/netbeans/pull/4499


-- 
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: notifications-unsubscribe@netbeans.apache.org

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 #4499: Initial implementation of (experimental) Dependency API in Gradle

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

   @lkishalmi The structure in Configuration is just (currently) just a graph, not an unrolled tree, so in "usual" projects it is rather slim. No `ArtifactSpec` structures are created in advance and the graph contains just GAVs of the target nodes. The tree is made only when someone asks for the DependencyResult.


-- 
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: notifications-unsubscribe@netbeans.apache.org

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 diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r945191429


##########
java/gradle.java/src/org/netbeans/modules/gradle/java/queries/TextDependencyScanner.java:
##########
@@ -0,0 +1,708 @@
+/*

Review Comment:
   OMG. Just wanted to add an ANTLR4 Lexer and Parser for simple Groovy based Gradle projects. Anyway, I still have to do that, so this is welcome!



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 a diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
sdedic commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r948040665


##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -319,6 +335,9 @@ GradleConfiguration createConfiguration(String name) {
      *         {@code null} for non-Gradle projects.
      */
     public static GradleBaseProject get(Project project) {
+        if (project == null) {

Review Comment:
   addressed in 2db82c7



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 #4499: Initial implementation of (experimental) Dependency API in Gradle

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

   Well, what I am curious is what the additional memory footprint of adding the dependencies into the GradleBaseProject the 10000+ nodes sounds scary.
   It would be good to know how essential this information would be. What I'm thinking about, that this info could be fetched/cached in a separate Model. Though that may require more work.
   
   I'm fine to put the dependency info (if it is not that exploded) in the GradleBaseProject. 
   
   So it would be good to now what would it put on the IDE on memory and probably on CPU. If it could be expensive let's move it to another model. It can be done later though, if you do not expose the dependencies through GradleBaseProject.


-- 
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: notifications-unsubscribe@netbeans.apache.org

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 diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r945190913


##########
java/gradle.java/nbproject/project.properties:
##########
@@ -24,4 +24,6 @@ javadoc.apichanges=${basedir}/apichanges.xml
 
 test-unit-sys-prop.test.netbeans.dest.dir=${netbeans.dest.dir}
 test-unit-sys-prop.java.awt.headless=true
-test.use.jdk.javac=true
\ No newline at end of file
+test.use.jdk.javac=true
+spec.version.base=1.19.0

Review Comment:
   Why are we moving the Specification-Version out of manifest.mf and use spec.version.base?
   I'm just curious.



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r945190262


##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -52,7 +53,7 @@ public final class GradleBaseProject implements Serializable, ModuleSearchSuppor
     String name;
     String group = "";
     String description;
-    String version;
+    String version = "";

Review Comment:
   ```null``` version value has a meaning. Gradle says it is ```unspecified```, when it is an empty string it is an empty string.



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 a diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
sdedic commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r947490209


##########
java/gradle.java/nbproject/project.properties:
##########
@@ -24,4 +24,6 @@ javadoc.apichanges=${basedir}/apichanges.xml
 
 test-unit-sys-prop.test.netbeans.dest.dir=${netbeans.dest.dir}
 test-unit-sys-prop.java.awt.headless=true
-test.use.jdk.javac=true
\ No newline at end of file
+test.use.jdk.javac=true
+spec.version.base=1.19.0

Review Comment:
   https://netbeans.apache.org/wiki/DevFaqImplementationDependency.asciidoc -- it's a way how to autoincrease spec version when the implementation dependency changes. I will move it back when I finalize the `project.dependency` module (based on feedback / findings when implementing Gradle, I'd allow some laziness, still not unsure how).



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 a diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
sdedic commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r948040331


##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -52,7 +53,7 @@ public final class GradleBaseProject implements Serializable, ModuleSearchSuppor
     String name;
     String group = "";
     String description;
-    String version;
+    String version = "";

Review Comment:
   addressed in 2db82c7



-- 
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: notifications-unsubscribe@netbeans.apache.org

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] ppisl commented on a diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
ppisl commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r947890895


##########
enterprise/cloud.oracle/src/org/netbeans/modules/cloud/oracle/adm/VulnerabilityWorker.java:
##########
@@ -161,7 +166,7 @@ public Map<String, Dependency> getDependencyMap() {
         
         private void buildDependecyMap(Dependency dependency, Map<String, Dependency> result) {
             String gav = createGAV(dependency.getArtifact());
-            result.put(gav, dependency);
+            result.putIfAbsent(gav, dependency);
             dependency.getChildren().forEach((childDependency) -> {

Review Comment:
   So the line above expect that there could be allredy pair gav : dependency in the result. In this case the dependency is not put again in the result but the children are recountned anyway. 



##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -206,6 +213,29 @@ public String getLicense() {
     public Map<String, File> getSubProjects() {
         return subProjects;
     }
+    
+    /**
+     * Finds a GAV for the given project. Returns {@code null} if the project path
+     * is not known (it is not referenced anywhere by this project), or has no known
+     * GAV. The project's own GAV should be always present, if defined by the project 
+     * file(s).
+     * 
+     * @param projectPath Gradle project path
+     * @return GAV coordinates, or {@code null}
+     * @since 2.27
+     */
+    public String findProjectGav(@NonNull String projectPath) {
+        if ("".equals(projectPath) || getPath().equals(projectPath)) {
+            String n = getName();
+            String g = getGroup();
+            String v = getVersion();
+            if (n == null || "".equals(n) || g == null || "".equals(g) || v == null || "".equals(v) || "unspecified".equals(v)) {  // NOI18N

Review Comment:
   Just minor. Using n.isEmpty(), q.isEmtpy() and v.isEmpty would be better here than the equals approach. The null check is done in the condition anyway. 



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 a diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
sdedic commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r945192449


##########
java/gradle.java/src/org/netbeans/modules/gradle/java/queries/TextDependencyScanner.java:
##########
@@ -0,0 +1,708 @@
+/*

Review Comment:
   Hm, I am working on output artifacts support and for that I'd need some other scanner, at least for simple name=value assignments to various task properties. I plan to supply the list of _possible_ property names (and structure members) from introspecting the tasks / extensions in the project, so the scanner could better ignore 'the unknown' stuff without having to be a full parser.
   Stay tuned, it's still in very rough state 



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 diff in pull request #4499: Initial implementation of (experimental) Dependency API in Gradle

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on code in PR #4499:
URL: https://github.com/apache/netbeans/pull/4499#discussion_r945190671


##########
extide/gradle/src/org/netbeans/modules/gradle/api/GradleBaseProject.java:
##########
@@ -319,6 +335,9 @@ GradleConfiguration createConfiguration(String name) {
      *         {@code null} for non-Gradle projects.
      */
     public static GradleBaseProject get(Project project) {
+        if (project == null) {

Review Comment:
   Is this needed? NbGradleProject.get() should return null on a null project.



-- 
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: notifications-unsubscribe@netbeans.apache.org

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 #4499: Initial implementation of (experimental) Dependency API in Gradle

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

   2 approvals, only `DebugRubyTest` and `DebugBaseTest` tests are failing which are unrelated to this PR. Going to merge in a few hours.


-- 
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: notifications-unsubscribe@netbeans.apache.org

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