You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by pr...@apache.org on 2019/04/17 18:58:43 UTC

[geode] branch develop updated: GEODE-6611: geode-all-bom does not import java-library (#3474)

This is an automated email from the ASF dual-hosted git repository.

prhomberg pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 447f508  GEODE-6611: geode-all-bom does not import java-library (#3474)
447f508 is described below

commit 447f508732929e282366794cb3fe6cf78dbe865c
Author: Robert Houghton <rh...@pivotal.io>
AuthorDate: Wed Apr 17 11:58:26 2019 -0700

    GEODE-6611: geode-all-bom does not import java-library (#3474)
    
    * Also roll to Gradle 5.4
    
    This project, per the Gradle docs, should use only java-platform plugin
    and not java-library as well, or else the published artifact is wrong
    for downstream consumption.  Additionally, this conflict is enforced in Gradle 5.4+
    
    * Enable dockerizedtest plugin on gradle 5.4
    
    Authored-by: Robert Houghton <rh...@pivotal.io>
---
 boms/build.gradle                                  |  5 --
 boms/geode-all-bom/build.gradle                    | 53 ++++++++++++++++++----
 .../DockerizedJavaExecHandleBuilder.groovy         | 12 ++++-
 .../dockerizedtest/DockerizedTestPlugin.groovy     |  6 ++-
 gradle.properties                                  |  2 +-
 gradle/wrapper/gradle-wrapper.properties           |  2 +-
 6 files changed, 62 insertions(+), 18 deletions(-)

diff --git a/boms/build.gradle b/boms/build.gradle
index 5c31f87..ae6f28c 100644
--- a/boms/build.gradle
+++ b/boms/build.gradle
@@ -14,8 +14,3 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
-
-jar.enabled = false
-
diff --git a/boms/geode-all-bom/build.gradle b/boms/geode-all-bom/build.gradle
index d1b38bd..52d22da 100644
--- a/boms/geode-all-bom/build.gradle
+++ b/boms/geode-all-bom/build.gradle
@@ -16,26 +16,54 @@
  */
 
 plugins {
+  id 'java-platform'
   id 'maven-publish'
+  id 'geode-dependency-constraints'
 }
 
-apply from: "${rootDir}/${scriptDir}/java.gradle"
-apply plugin: 'geode-dependency-constraints'
-apply from: "${rootDir}/${scriptDir}/publish.gradle"
 
-jar.enabled = false
+def apacheLicense = '''
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  '''
 
 publishing {
   publications {
     maven(MavenPublication) {
-      // publish.gradle injects 'from components.java', as well as some other pom configuration.
-      pom.packaging 'pom'
-      artifacts = []
+      from components.javaPlatform
 
       pom {
+        name = 'Apache Geode'
+        description = 'Apache Geode provides a database-like consistency model, reliable transaction processing and a shared-nothing architecture to maintain very low latency performance with high concurrency processing'
+        url = 'http://geode.apache.org'
+
+        scm {
+          url = 'https://github.com/apache/geode'
+          connection = 'scm:git:https://github.com:apache/geode.git'
+          developerConnection = 'scm:git:https://github.com:apache/geode.git'
+        }
+
+        licenses {
+          license {
+            name = 'The Apache Software License, Version 2.0'
+            url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+          }
+        }
         withXml {
           // Dependency constraints publish the scope of those constraints.
-          // We remove these from our published bom, as they should apply at all scopes. 
+          // We remove these from our published bom, as they should apply at all scopes.
           asNode().dependencyManagement.dependencies.dependency.each {
             dep -> dep.remove(dep['scope'])
           }
@@ -56,7 +84,16 @@ publishing {
           }
           thisNode
         }
+        withXml {
+          def providerAsElement = asElement()
+          providerAsElement.insertBefore(
+            providerAsElement.ownerDocument().createComment(apacheLicense),
+            providerAsElement.firstChild)
+        }
+
       }
     }
   }
 }
+
+apply from: "${rootDir}/${scriptDir}/check-pom.gradle"
diff --git a/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedJavaExecHandleBuilder.groovy b/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedJavaExecHandleBuilder.groovy
index 70ac705..8f4e04c 100644
--- a/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedJavaExecHandleBuilder.groovy
+++ b/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedJavaExecHandleBuilder.groovy
@@ -19,6 +19,7 @@ package com.pedjak.gradle.plugins.dockerizedtest
 import com.pedjak.gradle.plugins.dockerizedtest.DockerizedTestExtension
 import com.pedjak.gradle.plugins.dockerizedtest.ExitCodeTolerantExecHandle
 import com.pedjak.gradle.plugins.dockerizedtest.WorkerSemaphore
+import org.gradle.api.internal.file.FileCollectionFactory
 import org.gradle.api.internal.file.FileResolver
 import org.gradle.initialization.BuildCancellationToken
 import org.gradle.process.internal.*
@@ -27,6 +28,7 @@ import org.gradle.process.internal.streams.OutputStreamsForwarder
 import java.util.concurrent.Executor
 
 class DockerizedJavaExecHandleBuilder extends JavaExecHandleBuilder {
+    protected final FileCollectionFactory fileCollectionFactory
 
     def streamsHandler
     def executor
@@ -35,8 +37,14 @@ class DockerizedJavaExecHandleBuilder extends JavaExecHandleBuilder {
 
     private final WorkerSemaphore workersSemaphore
 
-    DockerizedJavaExecHandleBuilder(DockerizedTestExtension extension, FileResolver fileResolver, Executor executor, BuildCancellationToken buildCancellationToken, WorkerSemaphore workersSemaphore) {
-        super(fileResolver, executor, buildCancellationToken)
+    DockerizedJavaExecHandleBuilder(DockerizedTestExtension extension,
+                                    FileResolver fileResolver,
+                                    FileCollectionFactory fileCollectionFactory,
+                                    Executor executor,
+                                    BuildCancellationToken buildCancellationToken,
+                                    WorkerSemaphore workersSemaphore) {
+        super(fileResolver, fileCollectionFactory, executor, buildCancellationToken)
+        this.fileCollectionFactory = fileCollectionFactory
         this.extension = extension
         this.executor = executor
         this.buildCancellationToken = buildCancellationToken
diff --git a/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedTestPlugin.groovy b/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedTestPlugin.groovy
index 403c7c4..176fa58 100644
--- a/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedTestPlugin.groovy
+++ b/buildSrc/src/main/groovy/com/pedjak/gradle/plugins/dockerizedtest/DockerizedTestPlugin.groovy
@@ -26,6 +26,7 @@ import org.gradle.api.Action
 import org.gradle.api.GradleException
 import org.gradle.api.Plugin
 import org.gradle.api.Project
+import org.gradle.api.internal.file.DefaultFileCollectionFactory
 import org.gradle.api.tasks.testing.Test
 import org.gradle.initialization.DefaultBuildCancellationToken
 import org.gradle.internal.concurrent.DefaultExecutorFactory
@@ -104,8 +105,11 @@ class DockerizedTestPlugin implements Plugin<Project> {
         def executor = executorFactory.create("Docker container link")
         def buildCancellationToken = new DefaultBuildCancellationToken()
 
+        def defaultfilecollectionFactory = new DefaultFileCollectionFactory(project.fileResolver, null)
         def execHandleFactory = [newJavaExec: { ->
-            new com.pedjak.gradle.plugins.dockerizedtest.DockerizedJavaExecHandleBuilder(extension, project.fileResolver, executor, buildCancellationToken, workerSemaphore)
+            new DockerizedJavaExecHandleBuilder(
+              extension, project.fileResolver, defaultfilecollectionFactory,
+              executor, buildCancellationToken, workerSemaphore)
         }] as JavaExecHandleFactory
         new DefaultWorkerProcessFactory(defaultProcessBuilderFactory.loggingManager,
                 messagingServer,
diff --git a/gradle.properties b/gradle.properties
index 8b8b53f..6ee5f06 100755
--- a/gradle.properties
+++ b/gradle.properties
@@ -49,7 +49,7 @@ buildId = 0
 productName = Apache Geode
 productOrg = Apache Software Foundation (ASF)
 
-minimumGradleVersion = 5.2.1
+minimumGradleVersion = 5.4
 # Set this on the command line with -P or in ~/.gradle/gradle.properties
 # to change the buildDir location.  Use an absolute path.
 buildRoot=
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1b2b07c..ed5aaee 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,5 @@
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-all.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists