Skip to content

Commit 4063df4

Browse files
authored
Add gradle task to update the plugin version (#126)
1 parent 66a1f86 commit 4063df4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,14 @@ diffCoverageReport {
299299
failOnViolation = true
300300
}
301301
}
302+
303+
// updateVersion: Task to auto update version to the next development iteration
304+
task updateVersion {
305+
onlyIf { System.getProperty('newVersion') }
306+
doLast {
307+
ext.newVersion = System.getProperty('newVersion')
308+
println "Setting version to ${newVersion}."
309+
// String tokenization to support -SNAPSHOT
310+
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
311+
}
312+
}

0 commit comments

Comments
 (0)