forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
58 lines (50 loc) · 2.03 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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")]
}
}
}