gradle: do not attempt to filter versions

This commit is contained in:
Harsh Shandilya 2022-08-10 23:08:44 +05:30
parent 8d7a2df73d
commit c235d4feb2
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -21,7 +21,7 @@ class DependencyUpdatesPlugin : Plugin<Project> {
when (candidate.group) {
"com.squareup.okhttp3",
"org.jetbrains.kotlin" -> true
else -> isNonStable(candidate.version) && !isNonStable(currentVersion)
else -> false
}
}
checkForGradleUpdate = true
@ -30,12 +30,4 @@ class DependencyUpdatesPlugin : Plugin<Project> {
keep.keepUnusedLibraries.set(true)
}
}
private fun isNonStable(version: String): Boolean {
val stableKeyword =
listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase(Locale.ROOT).contains(it) }
val regex = "^[\\d,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
}