diff --git a/build.gradle b/build.gradle index 37e32e84..151a36f6 100644 --- a/build.gradle +++ b/build.gradle @@ -81,7 +81,7 @@ allprojects { } dependencies { - testCompile ('junit:junit:4.12') { + testCompile ('junit:junit:4.13.2') { exclude group: 'org.hamcrest' } testCompile "org.opensearch.plugin:reindex-client:${opensearch_version}" @@ -190,3 +190,23 @@ run { } apply from: 'build-tools/pkgbuild.gradle' + +// 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: ".github/workflows/build.yml") + include(name: ".github/workflows/multi-node-test-workflow.yml") + + } + } + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +} +