From 3d5a00e3b1b97281767601b2a24501b833b83684 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 10 Jul 2022 17:48:21 -0400 Subject: [PATCH 1/2] Version increment automation Signed-off-by: pgodithi --- build.gradle | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/build.gradle b/build.gradle index 36cdedd2f5..94d26d69a0 100644 --- a/build.gradle +++ b/build.gradle @@ -69,3 +69,20 @@ ext { dependencies { implementation 'junit:junit:4.12' } + +// versionIncrement: Task to auto increment to the next development iteration +task versionIncrement { + onlyIf { System.getProperty('newVersion') } + doLast { + ext.newVersion = System.getProperty('newVersion') + println "Setting version to ${newVersion}." + // String tokenization to support -SNAPSHOT + ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) { + fileset(dir: projectDir) { + // Include the required files that needs to be updated with new Version + include(name: "build.gradle") + include(name: ".github/workflows/CI-workflow.yml") + } + } + } +} \ No newline at end of file From 4faa65f98be3b729bb72e37037651fba83e1be7c Mon Sep 17 00:00:00 2001 From: pgodithi Date: Tue, 12 Jul 2022 18:10:54 -0400 Subject: [PATCH 2/2] Version increment automation: task rename updateVersion Signed-off-by: pgodithi --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 94d26d69a0..72ac909542 100644 --- a/build.gradle +++ b/build.gradle @@ -70,8 +70,8 @@ dependencies { implementation 'junit:junit:4.12' } -// versionIncrement: Task to auto increment to the next development iteration -task versionIncrement { +// updateVersion: Task to auto increment to the next development iteration +task updateVersion { onlyIf { System.getProperty('newVersion') } doLast { ext.newVersion = System.getProperty('newVersion')