-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
44 lines (38 loc) · 1.13 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
32
33
34
35
36
37
38
39
40
41
42
43
44
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.dependencyUpdates)
}
repositories {
mavenCentral()
gradlePluginPortal()
maven("https://dl.bintray.com/jakubriegel/kotlin-shell")
}
kotlin.sourceSets.all {
languageSettings.optIn("kotlin.RequiresOptIn")
}
dependencies {
implementation(libs.bundles.script)
implementation(libs.bundles.ktor)
}
tasks.withType<com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask> {
resolutionStrategy {
componentSelection {
all {
if (isNonStable(candidate.version) && !isNonStable(currentVersion)) {
reject("Release candidate")
}
}
}
}
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
tasks.named<Wrapper>("wrapper") {
gradleVersion = "8.8"
distributionType = Wrapper.DistributionType.ALL
}