From 1e9bba0b496cd932ccec9e9d2ec02952c0eb8a75 Mon Sep 17 00:00:00 2001 From: Prudhvi Godithi Date: Tue, 26 Jul 2022 17:17:20 -0400 Subject: [PATCH] Staging for version increment automation (#204) * Version increment automation Signed-off-by: pgodithi * Version increment automation: task rename updateVersion Signed-off-by: pgodithi (cherry picked from commit b3fd723a619f41169b54e5d089815bf3dcdd130c) Signed-off-by: prudhvigodithi --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 1341d345..344453c4 100644 --- a/build.gradle +++ b/build.gradle @@ -185,3 +185,14 @@ afterEvaluate { } } } +// 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 + // Include the required files that needs to be updated with new Version + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +} \ No newline at end of file