Skip to content

Commit b9edd7b

Browse files
author
Sevastyan Zhukov
authored
Set patch version for snapshots (#6853)
* Set patch version for snapshots * Change patch type
1 parent ce11135 commit b9edd7b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gradle/artifact-settings.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ def getSnapshotVersion(String version) {
4242
def matcher = version =~ /$prefix(\d+)\.(\d+)\.(\d+.*)/
4343
def major = (matcher[0][1] as Integer)
4444
def isPreRelease
45+
def patch = 0
4546
try {
46-
Integer.parseInt(matcher[0][3])
47+
patch = Integer.parseInt(matcher[0][3])
4748
isPreRelease = false
4849
} catch (NumberFormatException ignored) {
4950
isPreRelease = true
@@ -54,9 +55,9 @@ def getSnapshotVersion(String version) {
5455
}
5556
def branch = System.getenv("CIRCLE_BRANCH")
5657
if (!branch || branch == "main" || branch ==~ /release-v.*/) {
57-
return "${major}.${minor}.0-SNAPSHOT"
58+
return "${major}.${minor}.${patch}-SNAPSHOT"
5859
} else {
59-
return "${major}.${minor}.0-${branch}-SNAPSHOT"
60+
return "${major}.${minor}.${patch}-${branch}-SNAPSHOT"
6061
}
6162
}
6263
}

0 commit comments

Comments
 (0)