Skip to content

Commit c156ddb

Browse files
Simplify version method
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent 966d737 commit c156ddb

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

docs/spring-authorization-server-docs.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,5 @@ tasks.named("test") {
8686

8787
static String generateVersionWithoutPatch(String version) {
8888

89-
def matcher = version =~ /^(\d+.\d+).\d+(-SNAPSHOT|-M\d+)?$/
90-
if(matcher) {
91-
92-
return matcher[0][2] == null || matcher[0][2].startsWith("-M")
93-
? matcher[0][1]
94-
: matcher[0][1] + matcher[0][2]
95-
}
96-
97-
return version
89+
return version.split('\\.')[0, 1].join('.') + (version.endsWith('-SNAPSHOT') ? '-SNAPSHOT' : '')
9890
}

0 commit comments

Comments
 (0)