@@ -68,17 +68,28 @@ ext.testArtifact = { p, String name = "test" ->
68
68
}
69
69
70
70
tasks. register(" updateCIBwcVersions" ) {
71
- doLast {
72
- File yml = file(" .ci/bwcVersions" )
73
- yml. text = " "
74
- yml << " BWC_VERSION:\n "
75
- BuildParams . bwcVersions. indexCompatible. each {
76
- yml << " - \" $it \"\n "
71
+ def writeVersions = { File file , List<Version > versions ->
72
+ file. text = " "
73
+ file << " BWC_VERSION:\n "
74
+ versions. each {
75
+ file << " - \" $it \"\n "
77
76
}
78
77
}
78
+ doLast {
79
+ writeVersions(file(" .ci/bwcVersions" ), BuildParams . bwcVersions. indexCompatible)
80
+ writeVersions(file(" .ci/snapshotBwcVersions" ), BuildParams . bwcVersions. unreleasedIndexCompatible)
81
+ }
79
82
}
80
83
81
84
tasks. register(" verifyVersions" ) {
85
+ def verifyCiYaml = { File file , List<Version > versions ->
86
+ String ciYml = file. text
87
+ versions. each {
88
+ if (ciYml. contains(" \" $it \"\n " ) == false ) {
89
+ throw new Exception (" ${ file} is outdated, run `./gradlew updateCIBwcVersions` and check in the results" )
90
+ }
91
+ }
92
+ }
82
93
doLast {
83
94
if (gradle. startParameter. isOffline()) {
84
95
throw new GradleException (" Must run in online mode to verify versions" )
@@ -94,12 +105,8 @@ tasks.register("verifyVersions") {
94
105
.collect { Version . fromString(it) }
95
106
)
96
107
}
97
- String ciYml = file(" .ci/bwcVersions" ). text
98
- BuildParams . bwcVersions. indexCompatible. each {
99
- if (ciYml. contains(" \" $it \"\n " ) == false ) {
100
- throw new Exception (" .ci/bwcVersions is outdated, run `./gradlew updateCIBwcVersions` and check in the results" );
101
- }
102
- }
108
+ verifyCiYaml(file(" .ci/bwcVersions" ), BuildParams . bwcVersions. indexCompatible)
109
+ verifyCiYaml(file(" .ci/snapshotBwcVersions" ), BuildParams . bwcVersions. unreleasedIndexCompatible)
103
110
104
111
// Make sure backport bot config file is up to date
105
112
JsonNode backportConfig = new ObjectMapper (). readTree(file(" .backportrc.json" ))
0 commit comments