From 4235d868e40af29949ddbc91e7d9258f8003d64b Mon Sep 17 00:00:00 2001 From: Prudhvi Godithi Date: Tue, 26 Jul 2022 19:06:51 -0400 Subject: [PATCH] Staging for version increment automation (#409) * Version increment automation Signed-off-by: pgodithi * Version increment automation: task rename updateVersion Signed-off-by: pgodithi (cherry picked from commit 0f0ba16ddda2f3d22164564a295ede09fab71413) --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 62a230deb..7f61f0fb3 100644 --- a/build.gradle +++ b/build.gradle @@ -592,3 +592,14 @@ mixedCluster { systemProperty 'cluster.mixed', "$mixedClusterFlag" systemProperty 'cluster.number_of_nodes', "${_numNodes}" } + +// updateVersion: Task to auto increment to the next development iteration +task updateVersion { + onlyIf { System.getProperty('newVersion') } + doLast { + ext.newVersion = System.getProperty('newVersion') + println "Setting version to ${newVersion}." + // String tokenization to support -SNAPSHOT + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +}