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

Start moving documentation to Asciidoc #1243

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
57 changes: 57 additions & 0 deletions ci/publish-documentation-to-github-pages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

. $(pwd)/release-versions.txt

./mvnw -q -P '!setup-test-cluster' test-compile exec:java \
-Dexec.mainClass=io.micrometer.docs.DocsGeneratorCommand \
-Dexec.classpathScope="test" \
-Dexec.args='src/main/java/com/rabbitmq/client/observation/micrometer .* target/micrometer-observation-docs'

MESSAGE=$(git log -1 --pretty=%B)
./mvnw buildnumber:create pre-site --no-transfer-progress

make deps
./mvnw -q javadoc:javadoc -Dmaven.javadoc.failOnError=false

if [ -e target/site/apidocs/element-list ]
then cp target/site/apidocs/element-list target/site/apidocs/package-list
fi

RELEASE_VERSION=$(cat pom.xml | grep -oPm1 "(?<=<version>)[^<]+")

git checkout -- .mvn/maven.config

# GHA does shallow clones, so need the next 2 commands to have the gh-pages branch
git remote set-branches origin 'gh-pages'
git fetch -v

git checkout gh-pages
mkdir -p $RELEASE_VERSION/htmlsingle
cp target/generated-docs/index.html $RELEASE_VERSION/htmlsingle
mkdir -p $RELEASE_VERSION/api
cp -r target/site/apidocs/* $RELEASE_VERSION/api/
git add $RELEASE_VERSION/

if [[ $LATEST == "true" ]]
then
if [[ $RELEASE_VERSION == *[RCM]* ]]
then
DOC_DIR="milestone"
elif [[ $RELEASE_VERSION == *SNAPSHOT* ]]
then
DOC_DIR="snapshot"
else
DOC_DIR="stable"
fi

mkdir -p $DOC_DIR/htmlsingle
cp target/generated-docs/index.html $DOC_DIR/htmlsingle
mkdir -p $DOC_DIR/api
cp -r target/site/apidocs/* $DOC_DIR/api/
git add $DOC_DIR/

fi

git commit -m "$MESSAGE"
git push origin gh-pages
git checkout main
20 changes: 0 additions & 20 deletions deploy-javadoc.sh

This file was deleted.

6 changes: 0 additions & 6 deletions generate-observation-documentation.sh

This file was deleted.

88 changes: 88 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@
<jshell-maven-plugin.version>1.4</jshell-maven-plugin.version>
<spotless.version>2.43.0</spotless.version>
<google-java-format.version>1.19.2</google-java-format.version>
<buildnumber.plugin.version>3.2.0</buildnumber.plugin.version>
<asciidoctor.maven.plugin.version>2.2.5</asciidoctor.maven.plugin.version>
<asciidoctorj.version>2.5.11</asciidoctorj.version>
<asciidoctorj.diagram.version>2.2.14</asciidoctorj.diagram.version>
<!--
These groovy scripts are used later in this POM file to generate
source files and resources for the library itself and for the
Expand Down Expand Up @@ -814,6 +818,20 @@
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
<version>${micrometer.version}</version>
<scope>test</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jmx</artifactId>
<version>${metrics.version}</version>
<scope>test</scope>
<optional>true</optional>
</dependency>

</dependencies>

Expand Down Expand Up @@ -1079,6 +1097,76 @@
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>${buildnumber.plugin.version}</version>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
<revisionOnScmFailure>unknown</revisionOnScmFailure>
<shortRevisionLength>7</shortRevisionLength>
</configuration>
</plugin>


<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctorj.version}</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram</artifactId>
<version>${asciidoctorj.diagram.version}</version>
</dependency>
</dependencies>
<configuration>
<sourceDirectory>src/docs/asciidoc</sourceDirectory>
<doctype>article</doctype>
<embedAssets>true</embedAssets>
<requires>
<require>asciidoctor-diagram</require>
</requires>
<attributes>
<project-artifact-id>${project.artifactId}</project-artifact-id>
<project-version>${project.version}</project-version>
<build-number>${buildNumber}</build-number>
<imagesdir>./images</imagesdir>
<idprefix />
<idseparator>-</idseparator>
<source-highlighter>coderay</source-highlighter>
<test-examples>../../test/java/com/rabbitmq/docs</test-examples>
<build-directory>${project.build.directory}</build-directory>
</attributes>

</configuration>
<executions>
<execution>
<id>generate-html</id>
<phase>pre-site</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html5</backend>
<attributes>
<toc>left</toc>
<toclevels>5</toclevels>
<icons>font</icons>
<sectanchors>true</sectanchors>
</attributes>
</configuration>
</execution>
</executions>
</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down
Loading