Skip to content

Commit 1721428

Browse files
committed
[build] Enhance version parsing to support 4-part numeric versions
Signed-off-by: Violeta Georgieva <[email protected]>
1 parent 7ce5fe4 commit 1721428

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎build.gradle‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ static def qualifyVersion(String v) {
8686

8787
return "BAD"
8888
}
89-
//new scheme: major.minor.patch[-qualifier]
90-
def match = v =~ /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/
89+
//new scheme: major.minor.patch[.hotfix][-qualifier]
90+
//the hotfix segment uses a non-capturing group (?:...) so the qualifier stays at group(4)
91+
def match = v =~ /^(\d+)\.(\d+)\.(\d+)(?:\.\d+)?(?:-(.+))?$/
9192
if (!match.matches()) return "BAD"
9293

9394
def qualifier = match.group(4)

0 commit comments

Comments
 (0)