From a273c231fd409935343fc7e36fe5b62ee05201c8 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Mon, 17 May 2021 20:11:22 +0200 Subject: [PATCH] Add profile for generating javadocs and xref files (#11259) Motivation: When changing the netty-all artifact to not include any sources we also removed the ability to generate the javadocs / xref files for our website Modifications: - Add new profile which will generate the files - Add script which generates all the files and copy these over to the netty-website Result: Easier to generate files for website --- pom.xml | 99 +++++++++++++++++++++++++++++++++++++++- scripts/copy_javadocs.sh | 37 --------------- scripts/generate_docs.sh | 33 ++++++++++++++ 3 files changed, 130 insertions(+), 39 deletions(-) delete mode 100755 scripts/copy_javadocs.sh create mode 100755 scripts/generate_docs.sh diff --git a/pom.xml b/pom.xml index f2e28338c4..e677a89ff0 100644 --- a/pom.xml +++ b/pom.xml @@ -68,6 +68,102 @@ + + aggregate + + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.2.0 + + + aggregate + + aggregate + + + + + + **/com/sun/**/*.java + **/example/**/*.java + **/testsuite/**/*.java + **/microbench/**/*.java + **/microbenchmark/**/*.java + **/generated/**/*.java + + true + ${project.build.directory}/api + ${project.basedir}/src/javadoc/overview.html + Netty API Reference (${project.version}) + Netty API Reference (${project.version}) + false + + https://docs.oracle.com/javase/8/docs/api/ + https://developers.google.com/protocol-buffers/docs/reference/java/ + https://www.slf4j.org/apidocs/ + + + + Low-level data representation + io.netty.buffer* + + + Central interface for all I/O operations + io.netty.channel* + + + Client & Server bootstrapping utilities + io.netty.bootstrap* + + + Reusable I/O event interceptors + io.netty.handler* + + + DNS / Host resolvers + io.netty.resolver* + + + Utils + io.netty.util* + + + en_US + + + + org.apache.maven.plugins + maven-jxr-plugin + + + aggregate + + aggregate + + + + + true + ${project.build.directory}/site/xref + ${project.build.directory}/site/apidocs + Netty Source Xref (${project.version}) + Netty Source Xref (${project.version}) + + **/com/sun/**/*.java + **/example/**/*.java + **/microbench/**/*.java + **/microbenchmark/**/*.java + + + + + + graal @@ -1395,9 +1491,8 @@ 2.6 - maven-jxr-plugin - 2.2 + 3.1.1 maven-antrun-plugin diff --git a/scripts/copy_javadocs.sh b/scripts/copy_javadocs.sh deleted file mode 100755 index e41576a5f1..0000000000 --- a/scripts/copy_javadocs.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -set -e - -if [ "$#" -ne 1 ]; then - echo "Expected netty-website directory" - exit 1 -fi - -if [ ! -d "$1" ]; then - echo "$1 is not a directory" - exit 1 -fi - - -BRANCH=$(git branch --show-current) -WEBSITE_API_DIR="$1"/"$BRANCH"/api/ -WEBSITE_XREF_DIR="$1"/"$BRANCH"/xref/ -API_DIR=all/target/api/ -XREF_DIR=all/target/xref/ - -if [ ! -d "$API_DIR" ]; then - echo "$API_DIR not exists, didn't run the release process yet?" - exit 1 -fi - -if [ ! -d "$XREF_DIR" ]; then - echo "$XREF_DIR not exists, didn't run the release process yet?" - exit 1 -fi - -echo "Delete old javadocs and xref files" -rm -rf "$WEBSITE_API_DIR"/* -rm -rf "$WEBSITE_XREF_DIR"/* - -echo "Copy javadocs and xref files" -cp -r "$API_DIR"/* "$WEBSITE_API_DIR" -cp -r "$XREF_DIR"/* "$WEBSITE_XREF_DIR" diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh new file mode 100755 index 0000000000..aafc1100b4 --- /dev/null +++ b/scripts/generate_docs.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e +# Adjust for different branch if needed +VERSION=4.1 + +if [ "$#" -ne 2 ]; then + echo "Expected netty-website directory and tag" + exit 1 +fi + +if [ ! -d "$1" ]; then + echo "$1 is not a directory" + exit 1 +fi + + +BRANCH=$(git branch --show-current) +TAG="$2" +WEBSITE_API_DIR="$1"/"$VERSION"/api/ +WEBSITE_XREF_DIR="$1"/"$VERSION"/xref/ +API_DIR=target/site/apidocs/ +XREF_DIR=target/site/xref/ + +git checkout "$TAG" +JAVA_HOME=$JAVA8_HOME ./mvnw -Paggregate clean package javadoc:aggregate jxr:aggregate -DskipTests=true + +echo "Delete old javadocs and xref files" +rm -rf "$WEBSITE_API_DIR"/* +rm -rf "$WEBSITE_XREF_DIR"/* + +echo "Copy javadocs and xref files" +cp -r "$API_DIR"/* "$WEBSITE_API_DIR" +cp -r "$XREF_DIR"/* "$WEBSITE_XREF_DIR"