-
-
Notifications
You must be signed in to change notification settings - Fork 341
/
build.gradle.kts
97 lines (79 loc) · 2.55 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import io.github.gradlenexus.publishplugin.CloseNexusStagingRepository
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import java.time.Duration
buildscript {
dependencies {
classpath(kotlin("gradle-plugin", embeddedKotlinVersion))
}
}
plugins {
`lifecycle-base`
alias(libs.plugins.depUpdates)
// Needed to support publishing all modules atomically
alias(libs.plugins.gradlePublish) apply false
alias(libs.plugins.nexusPublish)
}
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
publishAlways()
}
nexusPublishing {
repositories {
sonatype {
username.set(System.getenv("SONATYPE_NEXUS_USERNAME"))
password.set(System.getenv("SONATYPE_NEXUS_PASSWORD"))
}
}
transitionCheckOptions {
// 15 minutes
delayBetween.set(Duration.ofSeconds(5))
maxRetries.set(180)
}
}
tasks.withType<CloseNexusStagingRepository> {
mustRunAfter(allprojects.map {
it.tasks.matching { task ->
task.name.contains("publishToSonatype")
}
})
}
val versionName = rootProject.file("version.txt").readText().trim()
allprojects {
version = versionName
group = "com.github.triplet.gradle"
afterEvaluate {
extensions.findByType<JavaPluginExtension>()?.apply {
toolchain.languageVersion.convention(JavaLanguageVersion.of(11))
withJavadocJar()
withSourcesJar()
}
extensions.findByType<KotlinProjectExtension>()?.apply {
sourceSets.configureEach {
languageSettings.progressiveMode = true
languageSettings.enableLanguageFeature("NewInference")
}
}
extensions.findByType<PublishingExtension>()?.apply {
configureMaven(repositories)
}
extensions.findByType<SigningExtension>()?.apply {
isRequired = false
useInMemoryPgpKeys(System.getenv("SIGNING_KEY"), System.getenv("SIGNING_PASSWORD"))
}
}
tasks.withType<Test> {
useJUnitPlatform()
maxHeapSize = "4g"
systemProperty("junit.jupiter.execution.parallel.enabled", true)
systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent")
testLogging {
events("passed", "failed", "skipped")
showStandardStreams = true
setExceptionFormat("full")
}
}
tasks.withType<ValidatePlugins>().configureEach {
enableStricterValidation.set(true)
}
}