Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apidocs classifier for publishing to docs.spring.io #3328

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions gradle/releaser.gradle
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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"
Expand Down Expand Up @@ -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')
Expand Down
30 changes: 29 additions & 1 deletion reactor-netty/build.gradle
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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/<version>/ 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)
Copy link
Member

@violetagg violetagg Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that we will publish this artifact to Maven Central?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, if this is an obstructive issue, is there a way to publish this new artifact to artifactory only ?
or alternatively, maybe there is another way: use rsync in order to push the javadocs/reference/pdf directly to docs.spring.io (then I'll need to explore that approach ...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm ... this is interesting: in spring-security, it seems that the docs are deployed in docs.spring.io by doing some ssh commands in groovy code, see this deployDocs groovy task in spring-security. maybe we should do the same.

I need to explore this; putting this PR in draft mode for the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could experiment this spring-security ssh commands, I see how it works and could test it using a local ssh server container.
I will close this current PR (because I don't want to loose it), and will create a new one based on the same approach used by spring-security.


description = "Reactor Netty with all modules"