Skip to content

Commit

Permalink
GEODE-6383: All subprojects should opt into configuration. (apache#3403)
Browse files Browse the repository at this point in the history
* The collection of java.gradle, ide.gradle, spotless.gradle et al have been collected to standard-subproject-configuration.gradle.
* This configuration is applied to every subproject to be consistent with previous behavior.  This will be audited and adjusted in GEODE-6611.
* Several cross-subproject evaluation dependencies have been made explicit.
  • Loading branch information
PurelyApplied authored Apr 8, 2019
1 parent 50c3747 commit 63bd991
Show file tree
Hide file tree
Showing 52 changed files with 778 additions and 651 deletions.
2 changes: 2 additions & 0 deletions boms/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

jar.enabled = false

4 changes: 3 additions & 1 deletion boms/geode-all-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
*/

plugins {
id 'geode-dependency-constraints'
id 'maven-publish'
}

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
apply plugin: 'geode-dependency-constraints'

apply from: "${project.projectDir}/../../gradle/publish.gradle"

jar.enabled = false
Expand Down
2 changes: 2 additions & 0 deletions boms/geode-client-bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

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

Expand Down
62 changes: 29 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ buildscript {

apply plugin: 'wrapper'
apply plugin: 'nebula.facet'
apply plugin: 'java-library'
apply plugin: 'idea'
apply plugin: 'eclipse'

apply from: "${scriptDir}/lint.gradle"
apply from: "${scriptDir}/resolve-dependencies.gradle"
apply from: "${scriptDir}/sonar.gradle"
apply from: "${scriptDir}/rat.gradle"

sourceCompatibility = 1.8
targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'

wrapper {
gradleVersion = minimumGradleVersion
Expand All @@ -62,36 +74,15 @@ allprojects {
}
}

apply from: "${scriptDir}/java.gradle"
apply from: "${scriptDir}/ide.gradle"
apply from: "${scriptDir}/dependency-resolution.gradle"
apply from: "${scriptDir}/test.gradle"
apply from: "${scriptDir}/code-analysis.gradle"
apply from: "${scriptDir}/sonar.gradle"
apply from: "${scriptDir}/rat.gradle"
apply from: "${scriptDir}/docker.gradle"
apply from: "${scriptDir}/spotless.gradle"
apply from: "${scriptDir}/lint.gradle"
apply from: "${scriptDir}/resolve-dependencies.gradle"

subprojects {
apply plugin: 'com.github.ben-manes.versions'
}
task combineReports(type: TestReport) {
description 'Combines the test reports.'
destinationDir = file "${rootProject.buildDir}/reports/combined"

check.dependsOn rat

task devBuild(dependsOn: [":assemble"]) {
description "A convenience target for a typical developer workflow: apply spotless and assemble all classes."
// spotless targets are not available until after evaluation.
subprojects {
afterEvaluate {
this.devBuild.dependsOn(project.spotlessApply)
}
doLast {
println "All test reports at ${rootProject.buildDir}/reports/combined"
}
}



ext.readScmInfo = { proj ->
// Attempt to read git information, or else return UNKNOWN
try {
Expand Down Expand Up @@ -121,7 +112,7 @@ ext.readScmInfo = { proj ->
}
}

task writeBuildInfo {
tasks.register('writeBuildInfo') {
def buildInfo = file "$buildDir/.buildinfo"
def scmInfo = this.readScmInfo("geode-core")

Expand All @@ -135,6 +126,12 @@ task writeBuildInfo {
}
}

tasks.register('devBuild') {
description "A convenience target for a typical developer workflow: apply spotless and assemble all classes."
dependsOn tasks.named('assemble')
// Each subproject injects its SpotlessApply as a dependency to this task in the standard config
}

tasks.register('generate') {
group = 'Build'
description = "Top-level target for all source generation. Helps IDE integration"
Expand Down Expand Up @@ -180,9 +177,8 @@ if (project.hasProperty('askpass')) {
}
}

// Explicitly chain generic tasks -- composite builds do not cascade these tasks by default.
['clean', 'check', 'test'].each { chainedTask ->
rootProject.tasks.named(chainedTask).configure {
dependsOn(subprojects*.tasks*.named(chainedTask))
}
}
gradle.taskGraph.whenReady({ graph ->
tasks.getByName('combineReports').reportOn rootProject.subprojects.collect {
it.tasks.withType(Test)
}.flatten()
})
2 changes: 2 additions & 0 deletions extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"
10 changes: 10 additions & 0 deletions extensions/geode-modules-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
* limitations under the License.
*/

evaluationDependsOn(':extensions:geode-modules')
evaluationDependsOn(':extensions:geode-modules-tomcat7')
evaluationDependsOn(':extensions:geode-modules-tomcat8')
evaluationDependsOn(':extensions:geode-modules-tomcat9')
evaluationDependsOn(':extensions:geode-modules-session')
evaluationDependsOn(':extensions:geode-modules-session-internal')


apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

import org.apache.geode.gradle.plugins.DependencyConstraints
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'maven-publish'
Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-session-internal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"



dependencies {
Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-session/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")


Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"



dependencies {
Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-tomcat7/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")


Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-tomcat8/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")


Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules-tomcat9/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")


Expand Down
2 changes: 2 additions & 0 deletions extensions/geode-modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import org.apache.geode.gradle.plugins.DependencyConstraints
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")


Expand Down
3 changes: 3 additions & 0 deletions extensions/session-testing-war/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply plugin: 'war'


Expand Down
16 changes: 13 additions & 3 deletions geode-assembly/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"


import org.apache.geode.gradle.plugins.DependencyConstraints

import java.nio.file.Paths

evaluationDependsOn(":geode-core")
evaluationDependsOn(":geode-protobuf-messages")

// This project aggressively reaches into many other projects and must wait for those configurations
// to be evaluated and resolved. As a safeguard against this and to avoid having to explicitly
// re-list every geode-* here, we instead depend on every subproject of rootProject, excluding this
// project itself. Additionally, this project also aggressively inspects its own subprojects.
// Evaluation depends on them all.
evaluationDependsOnChildren()
rootProject.subprojects.each { neighborProject ->
if (neighborProject != project) {
project.evaluationDependsOn(neighborProject.path)
}
}
apply plugin: 'distribution'
apply from: "${rootDir}/${scriptDir}/publish.gradle"

Expand Down
2 changes: 2 additions & 0 deletions geode-assembly/geode-assembly-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"




Expand Down
2 changes: 2 additions & 0 deletions geode-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions geode-concurrency-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions geode-connectors/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

evaluationDependsOn(":geode-core")

repositories {
Expand Down
2 changes: 2 additions & 0 deletions geode-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply plugin: 'antlr'
apply plugin: 'me.champeau.gradle.jmh'
apply from: "${project.projectDir}/../gradle/publish.gradle"
Expand Down
2 changes: 2 additions & 0 deletions geode-cq/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
2 changes: 2 additions & 0 deletions geode-dunit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
2 changes: 2 additions & 0 deletions geode-experimental-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
2 changes: 2 additions & 0 deletions geode-junit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
2 changes: 2 additions & 0 deletions geode-lucene/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
2 changes: 2 additions & 0 deletions geode-lucene/geode-lucene-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"




Expand Down
2 changes: 2 additions & 0 deletions geode-management/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions geode-memcached/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"

dependencies {
Expand Down
2 changes: 2 additions & 0 deletions geode-old-client-support/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

apply from: "${project.projectDir}/../gradle/publish.gradle"


Expand Down
4 changes: 4 additions & 0 deletions geode-old-versions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ import java.nio.file.Paths
* limitations under the License.
*/

apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

project.ext.installs = new Properties()
project.ext.versions = new Properties()

subprojects {
apply from: "${rootDir}/${scriptDir}/standard-subproject-configuration.gradle"

def oldGeodeVersion = project.name

boolean useTgz = (oldGeodeVersion >= "1.7.0")
Expand Down
Loading

0 comments on commit 63bd991

Please sign in to comment.