-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
28 lines (24 loc) · 1.09 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.com.android.application) apply false
alias(libs.plugins.org.jetbrains.kotlin.android) apply false
alias(libs.plugins.com.google.dagger.hilt.android) apply false
alias(libs.plugins.com.google.devtools.ksp) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.ktlint) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.com.github.ben.manes.versions)
alias(libs.plugins.nl.littlerobots.version.catalog.update)
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}