add versions plugin

This commit is contained in:
InsanusMokrassar 2023-06-27 16:46:45 +06:00
parent 2ddfffa6a9
commit bd2b5ae5fc
3 changed files with 20 additions and 0 deletions

View File

@ -17,6 +17,10 @@ buildscript {
} }
} }
plugins {
alias(libs.plugins.versions)
}
allprojects { allprojects {
repositories { repositories {
mavenLocal() mavenLocal()
@ -38,3 +42,4 @@ allprojects {
apply from: "./extensions.gradle" apply from: "./extensions.gradle"
apply from: "./github_release.gradle" apply from: "./github_release.gradle"
apply from: "./versions_plugin_setup.gradle"

View File

@ -24,6 +24,8 @@ okio = "3.3.0"
ksp = "1.8.20-1.0.11" ksp = "1.8.20-1.0.11"
kotlin-poet = "1.14.2" kotlin-poet = "1.14.2"
versions = "0.47.0"
android-gradle = "7.4.2" android-gradle = "7.4.2"
dexcount = "4.0.0" dexcount = "4.0.0"
@ -109,3 +111,5 @@ buildscript-android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gra
[plugins] [plugins]
jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" } jb-compose = { id = "org.jetbrains.compose", version.ref = "jb-compose" }
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }

View File

@ -0,0 +1,11 @@
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}