-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
85 lines (77 loc) · 2.35 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
plugins {
java
signing
`maven-publish`
id("org.checkerframework").version("0.6.28")
}
group = "me.moros"
version = "3.3.0"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
withJavadocJar()
withSourcesJar()
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("com.zaxxer", "HikariCP", "5.1.0")
}
tasks {
withType<Sign>().configureEach {
onlyIf { !isSnapshot() }
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
named<Copy>("processResources") {
from(rootProject.file("LICENSE")) {
rename { "META-INF/${it}_${rootProject.name.uppercase()}" }
}
}
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.name)
description.set("A utility library to easily build and wrap HikariDataSources")
url.set("https://github.com/PrimordialMoros/Storage")
licenses {
license {
name.set("The GNU Affero General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/agpl-3.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("moros")
name.set("Moros")
}
}
scm {
connection.set("scm:git:https://github.com/PrimordialMoros/Storage.git")
developerConnection.set("scm:git:ssh://[email protected]/PrimordialMoros/Storage.git")
url.set("https://github.com/PrimordialMoros/Storage")
}
issueManagement {
system.set("Github")
url.set("https://github.com/PrimordialMoros/Storage/issues")
}
}
}
repositories {
val snapshotUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
val releaseUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
maven {
name = "sonatype"
credentials(PasswordCredentials::class)
url = if (isSnapshot()) snapshotUrl else releaseUrl
}
}
}
signing {
sign(publishing.publications["maven"])
}
fun isSnapshot() = project.version.toString().endsWith("-SNAPSHOT")