-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
99 lines (85 loc) · 2.91 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
import net.researchgate.release.ReleaseExtension
val ossrhUsername = if (project.hasProperty("ossrhUsername")) {
project.property("ossrhUsername") as String?
} else {
System.getenv("OSSRH_USERNAME")
}
val ossrhPassword = if (project.hasProperty("ossrhPassword")) {
project.property("ossrhPassword") as String?
} else {
System.getenv("OSSRH_PASSWORD")
}
val jpmsAsString: String? = System.getProperty("jpms")
var isJpms: Boolean? = null
if (jpmsAsString != null) {
isJpms = jpmsAsString.toBoolean()
}
plugins {
`maven-publish`
signing
id("net.researchgate.release")
}
subprojects {
when {
(isJpms == true || name == "kotysa-java-tests") -> apply(plugin = "kotysa.jpms-no-mobile-conventions")
isJpms == false -> apply(plugin = "kotysa.client-only-conventions")
isJpms == null -> apply(plugin = "kotysa.dev-conventions")
}
apply(plugin = "maven-publish")
apply(plugin = "signing")
// --------------- publishing ---------------
publishing {
repositories {
maven {
if (project.version.toString().endsWith("SNAPSHOT")) {
setUrl("https://s01.oss.sonatype.org/content/repositories/snapshots/")
} else {
setUrl("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
}
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
}
publications.withType<MavenPublication> {
pom {
name.set(project.name)
description.set("Kotysa is the idiomatic way to write Kotlin type-safe SQL")
url.set("https://github.com/ufoss-org/kotysa")
licenses {
license {
name.set("The Unlicence")
url.set("https://unlicense.org")
}
}
developers {
developer {
name.set("pull-vert")
url.set("https://github.com/pull-vert")
}
}
scm {
connection.set("scm:git:https://github.com/ufoss-org/kotysa")
developerConnection.set("scm:git:git://github.com/ufoss-org/kotysa.git")
url.set("https://github.com/ufoss-org/kotysa.git")
}
}
}
}
signing {
// Require signing.keyId, signing.password and signing.secretKeyRingFile
sign(publishing.publications)
}
}
configure<ReleaseExtension> {
git {
requireBranch.set("master")
}
}
// when version changes :
// -> execute ./gradlew wrapper, then remove .gradle directory, then execute ./gradlew wrapper again
tasks.wrapper {
gradleVersion = "8.5"
distributionType = Wrapper.DistributionType.ALL
}