File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818
1919def getVersionName () {
2020 def cmd = " git describe --tag --abbrev=0"
21- def proc = cmd. execute()
22- def version = proc. text. trim()
23- return isSnapshot() ? getSnapshotVersion(version) : version
21+ def version = cmd. execute(). text. trim()
22+ return isSnapshot() ? getSnapshotVersion(version) : getReleaseVersion(version)
2423}
2524
2625def isSnapshot () {
@@ -29,9 +28,13 @@ def isSnapshot() {
2928 : false
3029}
3130
31+ private static def getReleaseVersion (String version ) {
32+ return version. substring(1 )
33+ }
34+
3235private static def getSnapshotVersion (String version ) {
3336 def matcher = version =~ / ^[v|V](\d +).(\d +)?.*/
3437 def major = (matcher[0 ][1 ] as Integer )
3538 def minor = (matcher[0 ][2 ] as Integer ) + 1
36- return " v ${ major} .${ minor} .0-SNAPSHOT"
39+ return " ${ major} .${ minor} .0-SNAPSHOT"
3740}
You can’t perform that action at this time.
0 commit comments