mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
59 lines
2.0 KiB
Groovy
59 lines
2.0 KiB
Groovy
plugins {
|
|
id "java"
|
|
id "org.springframework.boot.conventions"
|
|
}
|
|
|
|
description = "Spring Boot Configuration Metadata Changelog Generator"
|
|
|
|
configurations {
|
|
oldMetadata
|
|
newMetadata
|
|
}
|
|
|
|
dependencies {
|
|
implementation(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
|
|
implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-configuration-metadata"))
|
|
|
|
testImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies")))
|
|
testImplementation("org.assertj:assertj-core")
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
}
|
|
|
|
if (project.hasProperty("oldVersion") && project.hasProperty("newVersion")) {
|
|
dependencies {
|
|
["spring-boot",
|
|
"spring-boot-actuator",
|
|
"spring-boot-actuator-autoconfigure",
|
|
"spring-boot-autoconfigure",
|
|
"spring-boot-devtools",
|
|
"spring-boot-test-autoconfigure"].each {
|
|
oldMetadata("org.springframework.boot:$it:$oldVersion")
|
|
newMetadata("org.springframework.boot:$it:$newVersion")
|
|
}
|
|
}
|
|
|
|
def prepareOldMetadata = tasks.register("prepareOldMetadata", Sync) {
|
|
from(configurations.oldMetadata)
|
|
if (project.hasProperty("oldVersion")) {
|
|
destinationDir = project.file("build/configuration-metadata-diff/$oldVersion")
|
|
}
|
|
}
|
|
|
|
def prepareNewMetadata = tasks.register("prepareNewMetadata", Sync) {
|
|
from(configurations.newMetadata)
|
|
if (project.hasProperty("newVersion")) {
|
|
destinationDir = project.file("build/configuration-metadata-diff/$newVersion")
|
|
}
|
|
}
|
|
|
|
tasks.register("generate", JavaExec) {
|
|
inputs.files(prepareOldMetadata, prepareNewMetadata)
|
|
outputs.file(project.file("build/configuration-metadata-changelog.adoc"))
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass = 'org.springframework.boot.configurationmetadata.changelog.ChangelogGenerator'
|
|
if (project.hasProperty("oldVersion") && project.hasProperty("newVersion")) {
|
|
args = [project.file("build/configuration-metadata-diff/$oldVersion"), project.file("build/configuration-metadata-diff/$newVersion"), project.file("build/configuration-metadata-changelog.adoc")]
|
|
}
|
|
}
|
|
}
|