@@ -4,6 +4,9 @@ plugins {
4
4
5
5
id(" com.gradleup.shadow" ) version " 8.3.3"
6
6
7
+ `maven- publish`
8
+ signing
9
+
7
10
id(" xyz.jpenilla.run-paper" ) version " 2.3.1"
8
11
}
9
12
@@ -21,24 +24,26 @@ repositories {
21
24
}
22
25
23
26
dependencies {
24
- compileOnly (kotlin(" stdlib" ))
25
- compileOnly (kotlin(" reflect" ))
26
- compileOnly (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0" )
27
+ implementation (kotlin(" stdlib" ))
28
+ implementation (kotlin(" reflect" ))
29
+ implementation (" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0" )
27
30
28
- compileOnly (" io.papermc.paper:paper-api:$mcVersion -R0.1-SNAPSHOT" )
31
+ implementation (" io.papermc.paper:paper-api:$mcVersion -R0.1-SNAPSHOT" )
29
32
30
33
implementation(" org.bstats:bstats-bukkit:1.7" )
31
34
}
32
35
33
36
tasks {
34
- val filename = " ${project.name} -${project.version} .jar"
35
37
jar {
36
- archiveFileName = " original- $filename "
38
+ archiveClassifier = " original"
37
39
}
38
40
39
41
shadowJar {
40
- archiveFileName = filename
42
+ archiveClassifier = " "
41
43
relocate(" org.bstats" , " com.zp4rker.bukkot.bstats" )
44
+ dependencies {
45
+ include { it.moduleGroup == " org.bstats" }
46
+ }
42
47
}
43
48
44
49
processResources {
@@ -55,10 +60,81 @@ tasks {
55
60
dependsOn(shadowJar)
56
61
}
57
62
58
- runServer {
59
- minecraftVersion(mcVersion)
60
- subprojects.forEach {
61
- pluginJars(it.tasks.jar.map { jar -> jar.archiveFile })
63
+ create<Jar >(" javadocJar" ) {
64
+ archiveClassifier = " javadoc"
65
+ from(javadoc)
66
+ }
67
+ create<Jar >(" sourcesJar" ) {
68
+ archiveClassifier = " sources"
69
+ from(sourceSets[" main" ].allSource)
70
+ }
71
+ }
72
+
73
+ val sources = artifacts.add(" archives" , tasks[" sourcesJar" ])
74
+ val javadocs = artifacts.add(" archives" , tasks[" javadocJar" ])
75
+ val final = artifacts.add(" archives" , tasks[" shadowJar" ])
76
+
77
+ publishing {
78
+ publications {
79
+ create<MavenPublication >(" bukkot" ) {
80
+ artifactId = project.name
81
+ from(components[" kotlin" ])
82
+
83
+ artifact(sources)
84
+ artifact(javadocs)
85
+ artifact(final)
86
+
87
+ pom {
88
+ name = project.name
89
+ description = project.description
90
+ url = " https://github.com/zp4rker/bukkot"
91
+
92
+ packaging = " jar"
93
+
94
+ licenses {
95
+ license {
96
+ name = " The Apache License, Version 2.0"
97
+ url = " https://www.apache.org/licenses/LICENSE-2.0.txt"
98
+ }
99
+ }
100
+
101
+ developers {
102
+ developer {
103
+ id = " zp4rker"
104
+ name = " Zaeem Parker"
105
+
106
+ }
107
+ }
108
+
109
+ scm {
110
+ connection = " scm:git:git://github.com/zp4rker/bukkot.git"
111
+ url = " https://github.com/zp4rker/bukkot"
112
+ }
113
+
114
+ repositories {
115
+ maven {
116
+ val stagingUrl = " https://oss.sonatype.org/service/local/staging/deploy/maven2"
117
+ val snapshotsUrl = " https://oss.sonatype.org/content/repositories/snapshots"
118
+ url = uri(if (project.version.toString().endsWith(" -SNAPSHOT" )) snapshotsUrl else stagingUrl)
119
+ credentials {
120
+ username = System .getenv(" OSSRH_USERNAME" )
121
+ password = System .getenv(" OSSRH_PASSWORD" )
122
+ }
123
+ }
124
+ }
125
+ }
62
126
}
63
127
}
128
+ }
129
+
130
+ signing {
131
+ useGpgCmd()
132
+ sign(publishing.publications[" bukkot" ])
133
+ }
134
+
135
+ tasks.runServer {
136
+ minecraftVersion(mcVersion)
137
+ subprojects.forEach {
138
+ pluginJars(it.tasks.jar.map { jar -> jar.archiveFile })
139
+ }
64
140
}
0 commit comments