From 39b43da7d18be4941c2faa3700341c205ba05d46 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) Signed-off-by: prudhvigodithi --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index ba1f50ad1..c7fe414d9 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) + } +}