Skip to content

Commit

Permalink
Version increment automation: task rename updateVersion
Browse files Browse the repository at this point in the history
Signed-off-by: pgodithi <pgodithi@amazon.com>
  • Loading branch information
prudhvigodithi committed Jul 12, 2022
1 parent 6c8bcdb commit 1ead899
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -302,17 +302,14 @@ afterEvaluate {
}
}
}
task versionIncrement {
// 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 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 1ead899

Please sign in to comment.