Skip to content

Commit

Permalink
Staging for version increment automation (#204) (#210)
Browse files Browse the repository at this point in the history
* Version increment automation

Signed-off-by: pgodithi <[email protected]>

* Version increment automation: task rename updateVersion

Signed-off-by: pgodithi <[email protected]>
(cherry picked from commit b3fd723)
Signed-off-by: prudhvigodithi <[email protected]>

Signed-off-by: pgodithi <[email protected]>
Signed-off-by: prudhvigodithi <[email protected]>
Co-authored-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
1 parent 6c688eb commit f3dba24
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,14 @@ afterEvaluate {
}
}
}
// 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
// Include the required files that needs to be updated with new Version
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}

0 comments on commit f3dba24

Please sign in to comment.