@@ -140,22 +140,6 @@ shadowJar {
140140 classifier = null
141141}
142142
143- // versionIncrement: Task to auto increment to the next development iteration
144- task versionIncrement {
145- onlyIf { System . getProperty(' newVersion' ) }
146- doLast {
147- ext. newVersion = System . getProperty(' newVersion' )
148- println " Setting version to ${ newVersion} ."
149- // String tokenization to support -SNAPSHOT
150- ant. replaceregexp(match : opensearch_version. tokenize(' -' )[0 ], replace : newVersion. tokenize(' -' )[0 ], flags :' g' , byline :true ) {
151- fileset(dir : projectDir) {
152- // Include the required files that needs to be updated with new Version
153- include(name : " build.gradle" )
154- }
155- }
156- }
157- }
158-
159143task sourcesJar (type : Jar ) {
160144 classifier = ' sources'
161145 from sourceSets. main. allJava
@@ -211,3 +195,15 @@ publishing {
211195 gradle. startParameter. setShowStacktrace(ShowStacktrace . ALWAYS )
212196 gradle. startParameter. setLogLevel(LogLevel . DEBUG )
213197}
198+
199+ // updateVersion: Task to auto increment to the next development iteration
200+ task updateVersion {
201+ onlyIf { System . getProperty(' newVersion' ) }
202+ doLast {
203+ ext. newVersion = System . getProperty(' newVersion' )
204+ println " Setting version to ${ newVersion} ."
205+ // String tokenization to support -SNAPSHOT
206+ // Include the required files that needs to be updated with new Version
207+ ant. replaceregexp(file :' build.gradle' , match : ' "opensearch.version", "\\ d.*"' , replace : ' "opensearch.version", "' + newVersion. tokenize(' -' )[0 ] + ' -SNAPSHOT"' , flags :' g' , byline :true )
208+ }
209+ }
0 commit comments