-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (88 loc) · 2.87 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
103
104
105
106
107
plugins {
java
signing
`maven-publish`
id("com.gradleup.shadow") version "8.3.4" apply false
id("net.minecraftforge.gradlejarsigner") version "1.0.5"
}
repositories {
mavenCentral()
}
subprojects {
tasks.register<Jar>("sourcesJar") {
from(zipTree(tasks.jar.map { it.outputs.files.singleFile }))
archiveClassifier.set("sources")
}
}
tasks {
jar {
jarSigner.sign(jar.get())
val app = project(":kotlin").tasks.named("shadowJar")
dependsOn(app)
from(zipTree(app.map { it.outputs.files.singleFile }))
manifest { attributes("Main-Class" to "plazmaclip.PlazmaclipKt") }
rename { if (it.endsWith("-LICENSE.txt")) "META-INF/license/$it" else it }
}
register<Jar>("sourcesJar") {
val app = project(":kotlin").tasks.named("sourcesJar")
dependsOn(app)
from(zipTree(app.map { it.outputs.files.singleFile }))
archiveClassifier.set("sources")
}
}
publishing {
publications.register<MavenPublication>("maven") {
groupId = project.group.toString()
version = project.version.toString()
artifactId = "plazmaclip"
from(components["java"])
artifact(tasks["sourcesJar"])
withoutBuildIdentifier()
pom {
url.set("https://github.com/PlazmaMC/Plazmaclip")
name.set("plazmaclip")
description.set(project.description)
packaging = "jar"
licenses {
license {
name.set("MIT")
url.set("https://github.com/PlazmaMC/Plazmaclip/blob/main/LICENSE.md")
distribution.set("repo")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/PlazmaMC/Plazmaclip/issues")
}
developers {
developer {
id.set("AlphaKR93")
name.set("Alpha")
email.set("[email protected]")
url.set("https://alpha93.kr/")
}
}
scm {
url.set("https://github.com/PlazmaMC/Plazmaclip")
connection.set("scm:git:https://github.com/PlazmaMC/Plazmaclip.git")
developerConnection.set("scm:git:[email protected]:https://github.com/PlazmaMC/Plazmaclip.git")
}
}
}
repositories.maven("https://maven.pkg.github.com/PlazmaMC/Plazmaclip") {
name = "githubPackage"
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
}
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["maven"])
}
jarSigner {
autoDetect("")
}