[ 
https://issues.apache.org/jira/browse/GEODE-8239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17144103#comment-17144103
 ] 

ASF GitHub Bot commented on GEODE-8239:
---------------------------------------

rhoughton-pivot commented on a change in pull request #5297:
URL: https://github.com/apache/geode/pull/5297#discussion_r445061619



##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,41 @@ publishing {
     }
   }
 }
+
+gradle.taskGraph.whenReady({ graph ->
+  tasks.withType(Jar).each { jar ->
+    jar.doFirst {
+      def projectDependencies = []
+      def runtimeList = []
+
+      configurations.runtimeClasspath
+              .collect { it.name - ".jar" }
+              .each { dependency ->
+                if (dependency.startsWith("geode-")) {
+                  projectDependencies.add(dependency)
+                } else {
+                  runtimeList.add(dependency)
+                }
+              }
+
+      projectDependencies.clone().each { projectDependency ->

Review comment:
       Can we get a comment block on the logic of what is being pruned out from 
this list? I get it, but I also consulted on it in the first place

##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,41 @@ publishing {
     }
   }
 }
+
+gradle.taskGraph.whenReady({ graph ->
+  tasks.withType(Jar).each { jar ->
+    jar.doFirst {
+      def projectDependencies = []
+      def runtimeList = []
+
+      configurations.runtimeClasspath
+              .collect { it.name - ".jar" }
+              .each { dependency ->
+                if (dependency.startsWith("geode-")) {
+                  projectDependencies.add(dependency)
+                } else {
+                  runtimeList.add(dependency)
+                }
+              }
+
+      projectDependencies.clone().each { projectDependency ->
+        def geodeProject = projectDependency - "-${version}.jar"
+        if (projectDependencies.contains(geodeProject)) {
+          def parentProject = project(":$geodeProject" - "-$version")
+          if (parentProject != null) {
+            def collect = 
parentProject.configurations.runtimeClasspath.collect { it.name - ".jar" }
+            runtimeList.removeAll(collect)
+            projectDependencies.removeAll(collect)
+          }
+        }
+      }
+
+      manifest {
+        attributes.put("Class-Path", runtimeList.join(' '))

Review comment:
       Is Attributes.put() what avoids re-writing the entire block?




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


> Gradle configuration to create manifests for all Geode jars
> -----------------------------------------------------------
>
>                 Key: GEODE-8239
>                 URL: https://issues.apache.org/jira/browse/GEODE-8239
>             Project: Geode
>          Issue Type: Sub-task
>          Components: client/server
>            Reporter: Patrick Johnsn
>            Assignee: Patrick Johnsn
>            Priority: Major
>
> Modify the Gradle configuration to generate a manifest file with "Class-Path" 
> and "Dependent-Modules" attributes inside the jars. This manifest will be 
> used when defining modules using the jars.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to