-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.gradle.kts
63 lines (56 loc) · 2.01 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
plugins {
id("maven-publish")
id("com.github.ben-manes.versions") version "0.51.0"
id("net.ossindex.audit") version "0.4.11"
id("com.gradle.plugin-publish") version "1.3.0" apply false
id("io.freefair.maven-central.validate-poms") version "8.11"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
val dependencyVersions = listOf(
"com.squareup.okio:okio:3.9.1",
"com.squareup.okio:okio-jvm:3.9.1",
"org.jetbrains:annotations:26.0.1",
"org.jetbrains.kotlin:kotlin-reflect:2.1.0",
"org.jetbrains.kotlin:kotlin-stdlib:2.1.0",
"org.jetbrains.kotlin:kotlin-stdlib-common:2.1.0",
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.0",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0",
)
val dependencyVersionsByGroup = mapOf(
"org.codehaus.groovy" to "3.0.22",
)
subprojects {
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force(dependencyVersions)
eachDependency {
val forcedVersion = dependencyVersionsByGroup[requested.group]
if (forcedVersion != null) {
useVersion(forcedVersion)
}
}
}
}
}
fun findProperty(s: String) = project.findProperty(s) as String?
val isSnapshot = project.version == "unspecified"
nexusPublishing {
repositories {
if (!isSnapshot) {
sonatype {
// 'sonatype' is pre-configured for Sonatype Nexus (OSSRH) which is used for The Central Repository
stagingProfileId.set(System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: findProperty("sonatype.staging.profile.id")) //can reduce execution time by even 10 seconds
username.set(System.getenv("SONATYPE_USERNAME") ?: findProperty("sonatype.username"))
password.set(System.getenv("SONATYPE_PASSWORD") ?: findProperty("sonatype.password"))
}
}
}
}
//project.apply("debug.gradle.kts")
// https://gradle.org/release-checksums/
tasks.wrapper {
gradleVersion = "8.11.1"
distributionType = Wrapper.DistributionType.BIN
distributionSha256Sum = "f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6"
}