You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/24 18:02:53 UTC

[GitHub] [geode] yozaner1324 commented on a change in pull request #5297: GEODE-8239 - Add gradle config to add 'Class-Path' and 'Dependent-Modules' attirbutes to manifest file

yozaner1324 commented on a change in pull request #5297:
URL: https://github.com/apache/geode/pull/5297#discussion_r445075176



##########
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:
       Yes




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