-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
29 lines (24 loc) · 921 Bytes
/
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
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.moko.resources) apply false
alias(libs.plugins.gradle.versions) apply true
alias(libs.plugins.version.catalog.update) apply true
}
versionCatalogUpdate {
sortByKey = true
}
fun isStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
return stableKeyword || regex.matches(version)
}
tasks.withType<DependencyUpdatesTask> {
rejectVersionIf {
!isStable(candidate.version)
}
}