Skip to content

Commit 124ce1f

Browse files
committed
Remove v from snapshots and releases
1 parent c5901aa commit 124ce1f

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

gradle/artifact-settings.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ ext {
1818

1919
def 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

2625
def 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+
3235
private 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
}

0 commit comments

Comments
 (0)