Skip to content

Commit

Permalink
Version increment task 1.3 (#375)
Browse files Browse the repository at this point in the history
Signed-off-by: prudhvigodithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Jul 27, 2022
1 parent 1275cb2 commit f18149f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
}

0 comments on commit f18149f

Please sign in to comment.