|
1 | 1 | import com.nwalsh.gradle.saxon.SaxonXsltTask |
2 | | -import org.jreleaser.gradle.plugin.JReleaserExtension |
3 | | -import org.jreleaser.model.Active |
4 | | -import org.jreleaser.model.api.deploy.maven.MavenCentralMavenDeployer |
5 | 2 |
|
6 | 3 | buildscript { |
7 | 4 | repositories { |
@@ -34,10 +31,10 @@ buildscript { |
34 | 31 | plugins { |
35 | 32 | id("java-library") |
36 | 33 | id("maven-publish") |
| 34 | + id("signing") |
37 | 35 | id("com.github.gmazzo.buildconfig") version "5.3.5" |
38 | 36 | id("com.nwalsh.gradle.saxon.saxon-gradle") version "0.10.4" |
39 | 37 | id("com.nwalsh.gradle.relaxng.validate") version "0.10.3" |
40 | | - id("org.jreleaser") version "1.18.0" |
41 | 38 | } |
42 | 39 |
|
43 | 40 | val saxonVersion = project.properties["saxonVersion"].toString() |
@@ -109,6 +106,7 @@ tasks.jar { |
109 | 106 | } |
110 | 107 |
|
111 | 108 | tasks.javadoc { |
| 109 | + options.memberLevel = JavadocMemberLevel.PUBLIC |
112 | 110 | if (JavaVersion.current().isJava9Compatible) { |
113 | 111 | (options as StandardJavadocDocletOptions).addBooleanOption("html5", true) |
114 | 112 | } |
@@ -211,93 +209,62 @@ tasks.register<SaxonXsltTask>("website") { |
211 | 209 | ) |
212 | 210 | } |
213 | 211 |
|
| 212 | +tasks.register<Zip>("mavenReleaseArtifact") { |
| 213 | + dependsOn("publish") |
| 214 | + |
| 215 | + from(layout.buildDirectory.dir("maven")) |
| 216 | + archiveFileName = "maven-${basename}-${sincludeVersion}.zip" |
| 217 | +} |
| 218 | + |
214 | 219 | // ============================================================ |
215 | 220 |
|
216 | | -configure<PublishingExtension> { |
| 221 | +publishing { |
| 222 | + repositories { |
| 223 | + maven { |
| 224 | + url = uri("build/maven") |
| 225 | + } |
| 226 | + } |
| 227 | + |
217 | 228 | publications { |
218 | | - register<MavenPublication>("maven") { |
219 | | - from(components["java"]) |
| 229 | + create<MavenPublication>("mavenSInclude") { |
220 | 230 | pom { |
221 | | - name.set(project.name) |
222 | 231 | groupId = "com.nwalsh" |
223 | 232 | artifactId = "sinclude" |
224 | 233 | version = sincludeVersion |
225 | | - description.set(project.description ?: project.name) |
226 | | - url.set("https://github.com/ndw/sinclude") |
| 234 | + name = "Saxon XInclude" |
| 235 | + packaging = "jar" |
| 236 | + description = "An XInclude processor for Saxon" |
| 237 | + url = "https://github.com/ndw/sinclude" |
| 238 | + |
| 239 | + scm { |
| 240 | + url = "scm:git@github.com:ndw/sinclude.git" |
| 241 | + connection = "scm:git@github.com:ndw/sinclude.git" |
| 242 | + developerConnection = "scm:git@github.com:ndw/sinclude.git" |
| 243 | + } |
| 244 | + |
227 | 245 | licenses { |
228 | 246 | license { |
229 | | - name.set("Apache License version 2.0") |
230 | | - url.set("https://www.apache.org/licenses/LICENSE-2.0") |
| 247 | + name = "Apache License version 2.0" |
| 248 | + url = "https://www.apache.org/licenses/LICENSE-2.0" |
| 249 | + distribution = "repo" |
231 | 250 | } |
232 | 251 | } |
| 252 | + |
233 | 253 | developers { |
234 | 254 | developer { |
235 | | - id.set("com.nwalsh") |
236 | | - name.set("Norman Walsh") |
237 | | - email.set("ndw@nwalsh.com") |
| 255 | + id = "ndw" |
| 256 | + name = "Norman Walsh" |
238 | 257 | } |
239 | 258 | } |
240 | | - scm { |
241 | | - connection.set("scm:git@github.com:ndw/sinclude.git") |
242 | | - developerConnection.set("scm:git@github.com:ndw/sinclude.git") |
243 | | - url.set("https://github.com/ndw/sinclude") |
244 | | - } |
245 | 259 | } |
246 | 260 |
|
| 261 | + from(components["java"]) |
247 | 262 | artifact(sourcesJar.get()) |
248 | 263 | artifact(javadocJar.get()) |
249 | 264 | } |
250 | 265 | } |
251 | | - |
252 | | - repositories { |
253 | | - maven { |
254 | | - url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI() |
255 | | - } |
256 | | - } |
257 | 266 | } |
258 | 267 |
|
259 | | -configure<JReleaserExtension> { |
260 | | - gitRootSearch = true |
261 | | - project { |
262 | | - group = "com.nwalsh" |
263 | | - version = sincludeVersion |
264 | | - description = "An XInclude processor for Saxon" |
265 | | - authors = listOf("ndw") |
266 | | - license = "Apache License version 2.0" |
267 | | - links { |
268 | | - homepage = "https://github.com/ndw/sinclude" |
269 | | - bugTracker = "https://github.com/ndw/sinclude/issues" |
270 | | - contact = "https://github.com/ndw/sinclude" |
271 | | - } |
272 | | - inceptionYear = "2020" |
273 | | - vendor = "Norman Walsh" |
274 | | - copyright = "Copyright (c)2020-2025 Norman Walsh" |
275 | | - } |
276 | | - |
277 | | - release { |
278 | | - github { |
279 | | - commitAuthor { |
280 | | - name = "Norman Walsh" |
281 | | - email = "ndw@nwalsh.com" |
282 | | - } |
283 | | - } |
284 | | - } |
285 | | - |
286 | | - signing { |
287 | | - active = Active.ALWAYS |
288 | | - armored = true |
289 | | - } |
290 | | - |
291 | | - deploy { |
292 | | - maven { |
293 | | - mavenCentral { |
294 | | - register("sonatype") { |
295 | | - active = Active.ALWAYS |
296 | | - stage = MavenCentralMavenDeployer.Stage.UPLOAD |
297 | | - url = "https://central.sonatype.com/api/v1/publisher" |
298 | | - stagingRepositories.add("build/staging-deploy") |
299 | | - } |
300 | | - } |
301 | | - } |
302 | | - } |
| 268 | +signing { |
| 269 | + sign(publishing.publications["mavenSInclude"]) |
303 | 270 | } |
0 commit comments