diff --git a/build.gradle b/build.gradle index 83a2d277fe..5404a7de49 100644 --- a/build.gradle +++ b/build.gradle @@ -69,3 +69,20 @@ ext { dependencies { implementation 'junit:junit:4.12' } + +// 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(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") + } + } + } +}