-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
build.gradle.kts
56 lines (47 loc) · 1.61 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
45
46
47
48
49
50
51
52
53
54
55
56
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import io.github.serpro69.semverkt.gradle.plugin.tasks.TagTask
import utils.configureGradleDaemonJvm
plugins {
alias(libs.plugins.nexus.publish)
alias(libs.plugins.benmanes.versions)
}
group = "io.github.serpro69"
subprojects {
apply {
plugin("com.github.ben-manes.versions")
}
// don't apply the rest to bom subproject
if (this@subprojects.name == "bom") return@subprojects
tasks.withType<DependencyUpdatesTask> {
// disable for cli-bot because the classpath takes forever to resolve
enabled = this@subprojects.name != "cli-bot"
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
val regex = "^[0-9,.v-]+(-r|-jre)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
rejectVersionIf {
isNonStable(candidate.version)
}
}
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId.set(properties["stagingProfileId"]?.toString())
}
}
}
// Run :tag only after we've published artifacts to sonatype
tasks.withType<TagTask>().configureEach {
// don't apply when "dryRun"
findProperty("dryRun") ?: run {
dependsOn("closeSonatypeStagingRepository")
}
}
configureGradleDaemonJvm(
project = project,
updateDaemonJvm = tasks.updateDaemonJvm,
gradleDaemonJvmVersion = libs.versions.gradleDaemonJvm.map { JavaVersion.toVersion(it) },
)