-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
102 lines (93 loc) · 3 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
plugins {
`java-library`
signing
`maven-publish`
alias(libs.plugins.checker)
}
allprojects {
group = "me.moros"
version = "1.2.0"
apply(plugin = "java-library")
apply(plugin = "org.checkerframework")
repositories {
mavenCentral()
}
configure<JavaPluginExtension> {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
tasks {
withType<JavaCompile> {
options.compilerArgs.addAll(listOf("-Xlint:unchecked", "-Xlint:deprecation"))
options.encoding = "UTF-8"
}
withType<AbstractArchiveTask> {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
named<Copy>("processResources") {
from(rootProject.file("LICENSE")) {
rename { "META-INF/${it}_${rootProject.name.uppercase()}" }
}
}
}
}
subprojects {
apply(plugin = "signing")
apply(plugin = "maven-publish")
java {
if (!isSnapshot()) {
withJavadocJar()
}
withSourcesJar()
}
tasks {
withType<Sign>().configureEach {
onlyIf { !isSnapshot() }
}
}
publishing {
publications.create<MavenPublication>("maven") {
from(components["java"])
pom {
name.set(project.name)
description.set("Task scheduling framework for the JVM.")
url.set("https://github.com/PrimordialMoros/Tasker")
licenses {
license {
name.set("The GNU General Public License, Version 3.0")
url.set("https://www.gnu.org/licenses/gpl-3.0.txt")
distribution.set("repo")
}
}
developers {
developer {
id.set("moros")
name.set("Moros")
}
}
scm {
connection.set("scm:git:https://github.com/PrimordialMoros/Tasker.git")
developerConnection.set("scm:git:ssh://git@github.com/PrimordialMoros/Tasker.git")
url.set("https://github.com/PrimordialMoros/Tasker")
}
issueManagement {
system.set("Github")
url.set("https://github.com/PrimordialMoros/Tasker/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")