forked from Triple-T/gradle-play-publisher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (87 loc) · 2.73 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
98
99
100
101
102
103
104
105
106
107
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()
}
tasks.wrapper {
distributionType = Wrapper.DistributionType.ALL
}
tasks.register("configureGithubActions") {
doLast {
println("::set-output name=is_snapshot::$isSnapshotBuild")
}
}
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 {
convention.findByType<JavaPluginExtension>()?.apply {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}
convention.findByType<KotlinProjectExtension>()?.apply {
sourceSets.configureEach {
languageSettings.progressiveMode = true
languageSettings.enableLanguageFeature("NewInference")
}
}
convention.findByType<PublishingExtension>()?.apply {
configureMaven(repositories)
}
convention.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)
}
}