Skip to content

Commit

Permalink
GEODE-6611: geode-all-bom does not import java-library (apache#3474)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
robbadler authored and PurelyApplied committed Apr 17, 2019
1 parent 0e90b5a commit 447f508
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 18 deletions.
5 changes: 0 additions & 5 deletions boms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

53 changes: 45 additions & 8 deletions boms/geode-all-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
}
Expand All @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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.*
Expand All @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 447f508

Please sign in to comment.