diff --git a/build.gradle b/build.gradle index 93e85374..5cbb9a75 100644 --- a/build.gradle +++ b/build.gradle @@ -302,3 +302,17 @@ afterEvaluate { } } } +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") + } + } + } +} \ No newline at end of file