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/23 23:58:45 UTC

[GitHub] [geode] yozaner1324 opened a new pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

yozaner1324 opened a new pull request #5292:
URL: https://github.com/apache/geode/pull/5292


   Add Gradle config to generate manifest file containing 'Class-Path' and 'Dependent-Modules' attributes.
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


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



[GitHub] [geode] rhoughton-pivot commented on a change in pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
rhoughton-pivot commented on a change in pull request #5292:
URL: https://github.com/apache/geode/pull/5292#discussion_r444573116



##########
File path: gradle/java.gradle
##########
@@ -29,88 +29,65 @@ targetCompatibility = 1.8
 compileJava.options.encoding = 'UTF-8'
 
 dependencies {
-  // log4j-core has an annotation processor that is passed on the compile-classpath via geode-core and others.
-  // Fix Gradle warning here until we clean up our own classpath
-  annotationProcessor 'org.apache.logging.log4j:log4j-core:' + DependencyConstraints.get('log4j.version')
+    // log4j-core has an annotation processor that is passed on the compile-classpath via geode-core and others.
+    // Fix Gradle warning here until we clean up our own classpath
+    annotationProcessor 'org.apache.logging.log4j:log4j-core:' + DependencyConstraints.get('log4j.version')
 }
 
 String javaVersion = System.properties['java.version']
 if (javaVersion.startsWith("1.8.0") && javaVersion.split("-")[0].split("_")[1].toInteger() < 121) {
-  throw new GradleException("Java version 1.8.0_121 or later required, but was " + javaVersion)
+    throw new GradleException("Java version 1.8.0_121 or later required, but was " + javaVersion)
 }
 
 // apply compiler options
 gradle.taskGraph.whenReady({ graph ->
-  tasks.withType(JavaCompile).each { javac ->
-    javac.configure {
-      sourceCompatibility '1.8'
-      targetCompatibility '1.8'
-      options.encoding = 'UTF-8'
+    tasks.withType(JavaCompile).each { javac ->
+        javac.configure {
+            sourceCompatibility '1.8'
+            targetCompatibility '1.8'
+            options.encoding = 'UTF-8'
+        }
+        javac.options.incremental = true
+        javac.options.fork = true
+        javac.options.forkOptions.with({

Review comment:
       See above about indentation.

##########
File path: geode-modules/build.gradle
##########
@@ -163,5 +162,7 @@ dependencies {
     module4WithManifestCompileOnly(sourceSets.test.output)
     module5WithManifestCompileOnly(sourceSets.test.output)
 
-    module1WithManifestCompile('org.springframework:spring-core')
+    module1WithManifestCompile('com.google.guava:guava:29.0-jre')

Review comment:
       Check in `buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy` to see if this version is already defined

##########
File path: geode-modules/build.gradle
##########
@@ -163,5 +162,7 @@ dependencies {
     module4WithManifestCompileOnly(sourceSets.test.output)
     module5WithManifestCompileOnly(sourceSets.test.output)
 
-    module1WithManifestCompile('org.springframework:spring-core')
+    module1WithManifestCompile('com.google.guava:guava:29.0-jre')
+
+    testCompile(project(":geode-core"))

Review comment:
       Prefer `testImplementation` over `testCompile`

##########
File path: gradle.properties
##########
@@ -82,3 +82,4 @@ org.gradle.parallel = true
 
 org.gradle.internal.http.socketTimeout=120000
 org.gradle.internal.http.connectionTimeout=120000
+org.gradle.workers.max = 3

Review comment:
       Really not sure about this change. I think it will slow down builds a ton.

##########
File path: gradle/java.gradle
##########
@@ -29,88 +29,65 @@ targetCompatibility = 1.8
 compileJava.options.encoding = 'UTF-8'
 
 dependencies {
-  // log4j-core has an annotation processor that is passed on the compile-classpath via geode-core and others.
-  // Fix Gradle warning here until we clean up our own classpath
-  annotationProcessor 'org.apache.logging.log4j:log4j-core:' + DependencyConstraints.get('log4j.version')
+    // log4j-core has an annotation processor that is passed on the compile-classpath via geode-core and others.

Review comment:
       See above about indentation.

##########
File path: gradle/java.gradle
##########
@@ -17,10 +17,10 @@
 import org.apache.geode.gradle.plugins.DependencyConstraints
 
 if (project.name.endsWith("geode-all-bom")) {
-  // This anti-pattern is a workaround -- java-platform must be applied before java or java-library
-  // to avoid conflicts over redefining certain configurations.
-  // Evaluation as to whether java-platform should be applied at all is left to GEODE-6611.
-  apply plugin: 'java-platform'
+    // This anti-pattern is a workaround -- java-platform must be applied before java or java-library

Review comment:
       Please restore this to a two-space indent, and change style in a different PR.

##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,53 @@ 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(
+                "Manifest-Version": "1.0",

Review comment:
       Would love if we could merge the new attributes in, instead of overwriting. Any chance of that, before we merge to `develop` ?




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



[GitHub] [geode] kohlmu-pivotal commented on a change in pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
kohlmu-pivotal commented on a change in pull request #5292:
URL: https://github.com/apache/geode/pull/5292#discussion_r444574296



##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,53 @@ 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(
+                "Manifest-Version": "1.0",

Review comment:
       Yes.. we intended to merge this into `develop`. But we wanted to run against this feature branch first.




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



[GitHub] [geode] kohlmu-pivotal commented on a change in pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
kohlmu-pivotal commented on a change in pull request #5292:
URL: https://github.com/apache/geode/pull/5292#discussion_r444577930



##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,53 @@ 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(
+                "Manifest-Version": "1.0",

Review comment:
       We'll look into this before we submit PR to merge into `develop`




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



[GitHub] [geode] kohlmu-pivotal commented on a change in pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
kohlmu-pivotal commented on a change in pull request #5292:
URL: https://github.com/apache/geode/pull/5292#discussion_r444574296



##########
File path: gradle/publish-java.gradle
##########
@@ -28,3 +28,53 @@ 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(
+                "Manifest-Version": "1.0",

Review comment:
       Yes.. we intended to merge this into `develop`. But we wanted to run against this feature branch first.




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



[GitHub] [geode] yozaner1324 closed pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
yozaner1324 closed pull request #5292:
URL: https://github.com/apache/geode/pull/5292


   


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



[GitHub] [geode] kohlmu-pivotal commented on a change in pull request #5292: GEODE-8239 - Add Gradle config to generate manifest file

Posted by GitBox <gi...@apache.org>.
kohlmu-pivotal commented on a change in pull request #5292:
URL: https://github.com/apache/geode/pull/5292#discussion_r444574613



##########
File path: gradle.properties
##########
@@ -82,3 +82,4 @@ org.gradle.parallel = true
 
 org.gradle.internal.http.socketTimeout=120000
 org.gradle.internal.http.connectionTimeout=120000
+org.gradle.workers.max = 3

Review comment:
       yeah it will.. but also kills local machines if it uses every core for this... I'd proven it out on a 24 core box, with less "max workers" it actually worked faster than max cores.
   BUT, that said, this is local changes and can be left off PR.




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