Overhaul gradle build

- Focus of this commit is to have modern gradle build.
- Migrate most of a plugin configurations from dsl
  into buildSrc.
- This fixes issues with existing docs build.
- Allows to sign files so that we have that part
  done for central in a build.
- We can skip publishing samples.
- We're able to share similar logic for modules
  which are meant for publish or just being samples.
- It's easier to upgrade gradle versions without
  getting various build issues.
- Relates #1143
This commit is contained in:
Janne Valkealahti
2024-03-14 12:26:06 +00:00
parent 1b2a868ab5
commit e62b09d2bb
60 changed files with 2128 additions and 954 deletions

View File

@@ -1,5 +1,6 @@
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
maven { url 'https://repo.spring.io/release' }
if (version.contains('-')) {
@@ -9,15 +10,34 @@ pluginManagement {
maven { url 'https://repo.spring.io/snapshot' }
}
}
plugins {
id 'org.springframework.boot' version "$springBootVersion"
id 'com.gradle.enterprise' version "$gradleEnterpriseVersion"
id 'io.spring.ge.conventions' version "$springGeConventionsVersion"
}
}
plugins {
id 'com.gradle.enterprise' version '3.14.1'
id 'io.spring.ge.conventions' version '0.0.14'
id "com.gradle.enterprise"
id "io.spring.ge.conventions"
}
rootProject.name = 'spring-statemachine'
settings.gradle.projectsLoaded {
gradleEnterprise {
buildScan {
def buildDir = settings.gradle.rootProject.getBuildDir()
buildDir.mkdirs()
new File(buildDir, "build-scan-uri.txt").text = "build scan not generated"
buildScanPublished { scan ->
buildDir.mkdirs()
new File(buildDir, "build-scan-uri.txt").text = "<${scan.buildScanUri}|build scan>\n"
}
}
}
}
include 'spring-statemachine-platform'
include 'spring-statemachine-core'
include 'spring-statemachine-test'
@@ -56,21 +76,27 @@ include 'spring-statemachine-data:jpa'
include 'spring-statemachine-data:redis'
include 'spring-statemachine-data:mongodb'
rootProject.children.find {
if (it.name == 'spring-statemachine-recipes') {
it.name = 'spring-statemachine-recipes-common'
}
if (it.name == 'spring-statemachine-samples') {
it.name = 'spring-statemachine-samples-common'
it.children.each {
it.name = 'spring-statemachine-samples-' + it.name
include 'docs'
rootProject.children.each { project ->
if (project.name == 'spring-statemachine-data') {
project.name = 'spring-statemachine-data-common'
project.buildFileName = 'spring-statemachine-data.gradle'
project.children.each { subproject ->
subproject.buildFileName = "spring-statemachine-data-${subproject.name}.gradle"
subproject.name = 'spring-statemachine-data-' + subproject.name
}
}
if (it.name == 'spring-statemachine-data') {
it.name = 'spring-statemachine-data-common'
it.children.each {
it.name = 'spring-statemachine-data-' + it.name
} else if (project.name == 'spring-statemachine-recipes') {
project.name = 'spring-statemachine-recipes-common'
project.buildFileName = 'spring-statemachine-recipes.gradle'
} else if (project.name == 'spring-statemachine-samples') {
project.name = 'spring-statemachine-samples-common'
project.buildFileName = 'spring-statemachine-samples.gradle'
project.children.each { subproject ->
subproject.buildFileName = "spring-statemachine-samples-${subproject.name}.gradle"
subproject.name = 'spring-statemachine-samples-' + subproject.name
}
} else {
project.buildFileName = "${project.name}.gradle"
}
}