Created
August 7, 2018 07:51
-
-
Save yarinkos/0f006da5a624f9d16629201a8e1794ef to your computer and use it in GitHub Desktop.
groovy version upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version='1.0.11.1001' | |
// task incrementrevsion{ | |
def v = version | |
println v | |
String minor=v.substring(v.lastIndexOf('.')+1) //get last digit | |
int m=minor.toInteger()+1 //increment | |
// println m | |
String major=v.substring(0,v.lastIndexOf(".")); //get the beginning | |
// println major | |
String newVersion = major+"."+m | |
print newVersion | |
//String s=buildFile.getText().replaceFirst("version='$version'","version='"+major+ "." +m+"'") | |
//println s | |
//buildFile.setText(s) //replace the build file's text | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment