From b0fa5b04ba3143e3140a27798295e7b9c483a137 Mon Sep 17 00:00:00 2001 From: Pierre De Rop Date: Fri, 28 Jun 2024 18:14:53 +0200 Subject: [PATCH] Add apidocs classifier for publishing to docs.spring.io --- gradle/releaser.gradle | 16 ++++++++++------ reactor-netty/build.gradle | 30 +++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/gradle/releaser.gradle b/gradle/releaser.gradle index e6ffeea73b..e205be68a1 100644 --- a/gradle/releaser.gradle +++ b/gradle/releaser.gradle @@ -1,9 +1,5 @@ -import java.time.ZoneOffset -import java.time.ZonedDateTime -import java.time.temporal.ChronoField - /* - * Copyright (c) 2019-2021 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2019-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +13,9 @@ import java.time.temporal.ChronoField * See the License for the specific language governing permissions and * limitations under the License. */ - +import java.time.ZoneOffset +import java.time.ZonedDateTime +import java.time.temporal.ChronoField if (project.hasProperty("releaserDryRun") && project.findProperty("releaserDryRun") != "false") { println "Adding MavenLocal() for benefit of releaser dry run" @@ -96,6 +94,12 @@ if (project.hasProperty("artifactory_publish_password")) { username = "${artifactory_publish_username}" password = "${artifactory_publish_password}" } + defaults { + properties { + // Add artifactory metadata properties to deploy reactor-netty apidocs zip in docs.spring.io + all 'io.projectreactor.netty:reactor-netty:*:apidocs@zip', 'zip.name': 'reactor-netty', 'zip.displayname': 'Reactor Netty', 'zip.type': 'docs', 'zip.deployed': 'false' + } + } } clientConfig.setIncludeEnvVars(false) clientConfig.info.setBuildName('Reactor - Netty') diff --git a/reactor-netty/build.gradle b/reactor-netty/build.gradle index b68cc77e0e..7f1c701f63 100644 --- a/reactor-netty/build.gradle +++ b/reactor-netty/build.gradle @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2023 VMware, Inc. or its affiliates, All Rights Reserved. + * Copyright (c) 2020-2024 VMware, Inc. or its affiliates, All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,4 +42,32 @@ javadoc.dependsOn(aggregateJavadoc) //add docs.zip to the publication publishing.publications.mavenJava.artifact(docsZip) +// Define a task to create a reactor-netty apidocs zip classifier which includes both javadoc, reference doc, and reference pdf if any. +// this classifier will be published to artifactory using some special artifactory properties so it will be also +// published to https://docs.spring.io/projectreactor/netty/docs// directory. +// (see releaser.gradle which adds the specific properties metadata (zip.name / zip.deployed=false) +task apidocsZip(type: Zip, dependsOn: [asciidoctor, asciidoctorPdf]) { + archiveBaseName.set("reactor-netty") + archiveClassifier.set("apidocs") + + afterEvaluate() { + //we copy the pdf late, when a potential customVersion has been applied to rootProject + from(asciidoctorPdf) { + into("reference/pdf/") + rename("index.pdf", "reactor-netty-reference-guide-${rootProject.version}.pdf") + } + } + from(asciidoctor) { + includeEmptyDirs = false + exclude "**/index.pdf" + into("reference/html/") + } + from(aggregateJavadoc) { + into "api" + } +} + +//add apidocs.zip to the publication +publishing.publications.mavenJava.artifact(apidocsZip) + description = "Reactor Netty with all modules" \ No newline at end of file