You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.1 KiB
58 lines
2.1 KiB
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.ConfigurationMetadataChangelogGenerator' |
|
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")] |
|
} |
|
} |
|
}
|
|
|