refactor: replace deprecated methods in build.gradle.kts

This commit is contained in:
Gauthier Roebroeck 2023-06-26 11:01:45 +08:00
parent c4cdd7a60e
commit c70cab4a73

View file

@ -12,8 +12,8 @@ plugins {
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val unstableKeyword = listOf("ALPHA", "RC").any { version.toUpperCase().contains(it) }
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val unstableKeyword = listOf("ALPHA", "RC").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return unstableKeyword || !isStable