-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
69 lines (61 loc) · 2.5 KB
/
build.gradle.kts
File metadata and controls
69 lines (61 loc) · 2.5 KB
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
import java.text.SimpleDateFormat
import java.util.*
rootProject.extra.set("artifactVersion", SimpleDateFormat("yyyy-MM-dd\'T\'HH-mm-ss").format(Date()))
plugins {
id("maven-publish")
id("com.github.ben-manes.versions") version "0.53.0"
id("org.sonatype.gradle.plugins.scan") version "3.1.4"
id("io.freefair.maven-central.validate-poms") version "9.0.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
alias(libs.plugins.kotlinJvm) apply false
id("com.google.devtools.ksp") version "2.2.20-2.0.4" apply false
id("org.openapi.generator") version "7.16.0" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.3.0" apply false
}
val dependencyVersions = listOf(
libs.kotlinReflect,
libs.kotlinScriptRuntime,
libs.kotlinStdlib,
libs.kotlinCommon,
libs.kotlinJdk7,
libs.kotlinJdk8,
libs.slf4j,
)
val dependencyGroupVersions = mapOf<String, String>(
// "org.junit.jupiter" to "5.10.2",
// "org.junit.platform" to "1.10.2",
)
subprojects {
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force(dependencyVersions)
eachDependency {
val forcedVersion = dependencyGroupVersions[requested.group]
if (forcedVersion != null) {
useVersion(forcedVersion)
}
}
}
}
}
ossIndexAudit {
username = System.getenv("SONATYPE_INDEX_USERNAME") ?: findProperty("sonatype.index.username")
password = System.getenv("SONATYPE_INDEX_PASSWORD") ?: findProperty("sonatype.index.password")
}
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"))
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
}
}
}