-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
30 lines (26 loc) · 940 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
30
// Copyright (c) 2024 Erwin Kok. BSD-3-Clause license. See LICENSE file for more details.
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
plugins {
alias(libs.plugins.build.versions)
alias(libs.plugins.build.nexus)
}
nexusPublishing {
packageGroup.set("org.erwinkok.libp2p")
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
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)
}
}