1
1
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2
- import org.gradle.api.tasks.testing.logging.TestExceptionFormat
3
2
import io.github.patrick.gradle.remapper.RemapTask
3
+ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
4
4
5
5
plugins {
6
6
`java- library`
@@ -10,7 +10,6 @@ plugins {
10
10
}
11
11
12
12
group = " com.comphenix.protocol"
13
- version = " 5.4.0-SNAPSHOT"
14
13
description = " Provides access to the Minecraft protocol"
15
14
16
15
val mcVersion = " 1.21.4"
@@ -69,30 +68,6 @@ dependencies {
69
68
java {
70
69
sourceCompatibility = JavaVersion .VERSION_17
71
70
targetCompatibility = JavaVersion .VERSION_17
72
-
73
- withJavadocJar()
74
- withSourcesJar()
75
- }
76
-
77
- publishing {
78
- publications.withType<MavenPublication > {
79
- artifactId = " ProtocolLib"
80
- }
81
-
82
- repositories {
83
- maven {
84
- url = if (isSnapshot) {
85
- uri(" https://repo.dmulloy2.net/repository/snapshots/" )
86
- } else {
87
- uri(" https://repo.dmulloy2.net/repository/releases/" )
88
- }
89
-
90
- credentials {
91
- username = System .getenv(" NEXUS_USERNAME" )
92
- password = System .getenv(" NEXUS_PASSWORD" )
93
- }
94
- }
95
- }
96
71
}
97
72
98
73
tasks {
@@ -145,4 +120,84 @@ tasks {
145
120
compileJava {
146
121
options.encoding = " UTF-8"
147
122
}
123
+
124
+ register< org.gradle.jvm.tasks.Jar > (" javadocJar" ) {
125
+ archiveClassifier.set(" javadoc" )
126
+ from(getByName(" javadoc" ))
127
+ }
128
+
129
+ register< org.gradle.jvm.tasks.Jar > (" sourcesJar" ) {
130
+ archiveClassifier.set(" sources" )
131
+ from(project.the<JavaPluginExtension >().sourceSets[" main" ].allJava)
132
+ }
133
+ }
134
+
135
+ publishing {
136
+ publications {
137
+ create<MavenPublication >(" maven" ) {
138
+ from(components[" java" ])
139
+ artifact(tasks.getByName(" sourcesJar" ))
140
+ artifact(tasks.getByName(" javadocJar" ))
141
+
142
+ pom {
143
+ name.set(project.name)
144
+ description.set(project.description)
145
+ url.set(" https://github.com/dmulloy2/ProtocolLib" )
146
+
147
+ developers {
148
+ developer {
149
+ id.set(" dmulloy2" )
150
+ name.set(" Dan Mulloy" )
151
+ url.set(" https://dmulloy2.net/" )
152
+ }
153
+ developer {
154
+ id.set(" aadnk" )
155
+
156
+ name.set(" Kristian S. Stangeland" )
157
+ url.set(" https://comphenix.net/" )
158
+ }
159
+ }
160
+
161
+ licenses {
162
+ license {
163
+ name.set(" GNU GENERAL PUBLIC LICENSE - Version 2, June 1991" )
164
+ url.set(" https://www.gnu.org/licenses/gpl-2.0.txt" )
165
+ distribution.set(" repo" )
166
+ }
167
+ }
168
+
169
+ scm {
170
+ tag.set(" HEAD" )
171
+ url.set(" https://github.com/dmulloy2/ProtocolLib" )
172
+ connection.set(" scm:git:git://github.com/dmulloy2/ProtocolLib.git" )
173
+ developerConnection.set(
" scm:git:[email protected] :dmulloy2/ProtocolLib.git" )
174
+ }
175
+
176
+ issueManagement {
177
+ system.set(" GitHub Issues" )
178
+ url.set(" https://github.com/dmulloy2/ProtocolLib/issues" )
179
+ }
180
+
181
+ ciManagement {
182
+ system.set(" Jenkins" )
183
+ url.set(" https://ci.dmulloy2.net/job/ProtocolLib" )
184
+ }
185
+ }
186
+ }
187
+ }
188
+
189
+ repositories {
190
+ maven {
191
+ url = if (isSnapshot) {
192
+ uri(" https://repo.dmulloy2.net/repository/snapshots/" )
193
+ } else {
194
+ uri(" https://repo.dmulloy2.net/repository/releases/" )
195
+ }
196
+
197
+ credentials {
198
+ username = System .getenv(" NEXUS_USERNAME" )
199
+ password = System .getenv(" NEXUS_PASSWORD" )
200
+ }
201
+ }
202
+ }
148
203
}
0 commit comments