Skip to content

Commit 366bf16

Browse files
Staging for version increment automation (#200)
* Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation: task rename updateVersion Signed-off-by: pgodithi <pgodithi@amazon.com>
1 parent 48c2271 commit 366bf16

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,15 @@ publishing {
199199
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
200200
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
201201
}
202+
203+
// updateVersion: Task to auto increment to the next development iteration
204+
task updateVersion {
205+
onlyIf { System.getProperty('newVersion') }
206+
doLast {
207+
ext.newVersion = System.getProperty('newVersion')
208+
println "Setting version to ${newVersion}."
209+
// String tokenization to support -SNAPSHOT
210+
// Include the required files that needs to be updated with new Version
211+
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
212+
}
213+
}

0 commit comments

Comments
 (0)