-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
31 lines (27 loc) · 1.05 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
29
30
31
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
alias(libs.plugins.checker)
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.jetbrainsCompose) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.sqldelight) apply false
alias(libs.plugins.mokoResources) apply false
alias(libs.plugins.serialization) apply false
alias(libs.plugins.composeCompiler) apply false
}
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> {
gradleReleaseChannel = "current"
rejectVersionIf {
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}