Skip to content

Commit

Permalink
GEODE-10283: Remove problematic buildSrc project, replacing with incl…
Browse files Browse the repository at this point in the history
…udeBuild projects (apache#7600)

* Extract DependencyConstraints plugin from buildSrc
* Extract japicmp plugin customization from buildSrc
* Test isolation from buildSrc
* Disable jacoco on all test facets by default

Co-authored-by: Your Name <you@example.com>
  • Loading branch information
robbadler and Your Name committed May 11, 2022
1 parent 5843fee commit 509c0c6
Show file tree
Hide file tree
Showing 134 changed files with 1,120 additions and 358 deletions.
5 changes: 3 additions & 2 deletions boms/geode-all-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@

plugins {
id 'java-platform'
id 'geode-dependency-constraints'
id 'org.apache.geode.gradle.geode-dependency-constraints'
id 'geode-publish-common'
}

apply from: "${rootDir}/gradle/publish-common.gradle"
DependencyConstraints.apply(project)

publishing {
publications {
Expand Down
8 changes: 5 additions & 3 deletions boms/geode-client-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
plugins {
id 'standard-subproject-configuration'
id 'io.spring.dependency-management'
id 'geode-publish-common'
}

apply plugin: "io.spring.dependency-management"
apply from: "${project.projectDir}/../../gradle/publish-common.gradle"

jar.enabled = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,32 @@

plugins {
id 'java'
id 'java-gradle-plugin'
id 'groovy-gradle-plugin'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.18.0'
}

repositories {
mavenCentral()
gradlePluginPortal() {
content {
includeModule('me.champeau.gradle', 'japicmp-gradle-plugin')
}
}
}

dependencies {
testRuntimeOnly('org.apache.geode:geode-junit:1.3.0') {
transitive(false)
}
implementation(gradleApi())
implementation('org.apache.commons:commons-lang3:3.12.0')
implementation('org.apache.maven:maven-artifact:3.8.5')
implementation('com.google.guava:guava:31.1-jre')
implementation('me.champeau.gradle:japicmp-gradle-plugin:0.3.0')
implementation('junit:junit:4.13.2')

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'

testAnnotationProcessor(this.project)
}

test {
useJUnitPlatform()
}

sourceSets {
main {
java {
Expand Down
18 changes: 18 additions & 0 deletions build-tools/geode-annotation-processor/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

rootProject.name = 'geode-annotation-processor'
51 changes: 51 additions & 0 deletions build-tools/geode-build-tools/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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.
*
*/

plugins {
id 'java'
id 'java-gradle-plugin'
id 'groovy-gradle-plugin'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.18.0'
}

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation(gradleApi())

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
useJUnitPlatform()
}

group = 'org.apache.geode.gradle'
version = 1.0

gradlePlugin {
plugins.register('geode-build-tools') {
id = 'org.apache.geode.gradle.geode-build-tools'
implementationClass = 'org.apache.geode.gradle.plugins.BuildToolsPlugin'
}
}
18 changes: 18 additions & 0 deletions build-tools/geode-build-tools/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

rootProject.name = 'geode-build-tools'
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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.
*/
package org.apache.geode.gradle.plugins;

import org.gradle.api.Plugin;
import org.gradle.api.Project;

public class BuildToolsPlugin implements Plugin<Project> {
public void apply(Project project) {
// this plugin doesn't create any task by default
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.geode.gradle.plugins

import groovy.swing.SwingBuilder

class PasswordDialog {
static String askPassword(String prompt) {
def password = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.
*/

package org.apache.geode.gradle.plugins

import java.io.BufferedWriter
import java.io.File
import java.util.Properties

class TestPropertiesWriter {
static void writeTestProperties(File parent, String name) {
Properties props = new Properties()
props.setProperty('log-level', 'config')
File propsFile = new File(testResultsDir(parent, name), 'gemfire.properties')
BufferedWriter writer = propsFile.newWriter()
props.store(writer, 'Autogenerated Gemfire properties')
}

static File testResultsDir(File parent, String name) {
return new File(parent, name)
}
}


49 changes: 49 additions & 0 deletions build-tools/geode-dependency-management/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* 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.
*
*/

plugins {
id 'java'
id 'groovy-gradle-plugin'
}

repositories {
mavenCentral()
gradlePluginPortal()
}

dependencies {
implementation(gradleApi())
}

sourceSets {
main {
java {
srcDirs = []
}
groovy {
srcDirs += ['src/main/java']
}
}
}

gradlePlugin {
plugins.register('geode-dependency-constraints') {
id = 'org.apache.geode.gradle.geode-dependency-constraints'
implementationClass = 'org.apache.geode.gradle.plugins.DependencyConstraintsPlugin'
}
}
18 changes: 18 additions & 0 deletions build-tools/geode-dependency-management/settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

rootProject.name = 'geode-dependency-management'
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@

package org.apache.geode.gradle.plugins

import org.gradle.api.Plugin
import org.gradle.api.Project

class DependencyConstraints implements Plugin<Project> {
/** By necessity, the version of those plugins used in the build-scripts are defined in the
* buildscript {} configuration in the root project's build.gradle. */
class DependencyConstraints {
/** By necessity, the version of those plugins used in the build-scripts are defined in the
* buildscript {} configuration in the root project's build.gradle. */
static Map<String,String> disparateDependencies = initExternalDependencies()

static String get(String name) {
Expand Down Expand Up @@ -75,7 +74,6 @@ class DependencyConstraints implements Plugin<Project> {
return deps
}

@Override
void apply(Project project) {
def dependencySet = { Map<String, String> group_and_version, Closure closure ->
DependencySetHandler delegate =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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.
*/

package org.apache.geode.gradle.plugins

import org.gradle.api.Plugin
import org.gradle.api.Project

class DependencyConstraintsPlugin implements Plugin<Project> {

@Override
void apply(Project project) {
project.extensions.create("DependencyConstraints", DependencyConstraints)
}
}

0 comments on commit 509c0c6

Please sign in to comment.