forked from apache/cassandra-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 40
docs: build multiversion Javadocs with matching JDKs #909
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
Open
dkropachev
wants to merge
1
commit into
scylladb:scylla-4.x
Choose a base branch
from
dkropachev:dk/fix-docs-multiversion-jdk-selection
base: scylla-4.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,34 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # Install dependencies | ||
| mvn install -DskipTests -T 1C | ||
| mvn install -DskipTests -Dmaven.javadoc.skip=true -T 1C | ||
|
|
||
| # Define output folder | ||
| OUTPUT_DIR="docs/_build/dirhtml/api" | ||
| if [[ "$SPHINX_MULTIVERSION_OUTPUTDIR" != "" ]]; then | ||
| if [[ "${SPHINX_MULTIVERSION_OUTPUTDIR:-}" != "" ]]; then | ||
| OUTPUT_DIR="$SPHINX_MULTIVERSION_OUTPUTDIR/api" | ||
| echo "HTML_OUTPUT = $OUTPUT_DIR" >> doxyfile | ||
| fi | ||
|
|
||
| # Generate javadoc | ||
| mvn javadoc:javadoc -T 1C | ||
| [ -d $OUTPUT_DIR ] && rm -r $OUTPUT_DIR | ||
| JAVADOC_SOURCE_DIR="core/target/site/apidocs" | ||
| if [[ ! -d "$JAVADOC_SOURCE_DIR" && -d "core/target/reports/apidocs" ]]; then | ||
| JAVADOC_SOURCE_DIR="core/target/reports/apidocs" | ||
| fi | ||
| if [[ ! -d "$JAVADOC_SOURCE_DIR" ]]; then | ||
| echo "Javadoc output directory was not generated" >&2 | ||
| exit 1 | ||
| fi | ||
| shopt -s nullglob | ||
| JAVADOC_FILES=("$JAVADOC_SOURCE_DIR"/*) | ||
| if (( ${#JAVADOC_FILES[@]} == 0 )); then | ||
| echo "Javadoc output directory is empty" >&2 | ||
| exit 1 | ||
| fi | ||
| if [[ -d "$OUTPUT_DIR" ]]; then | ||
| rm -r "$OUTPUT_DIR" | ||
| fi | ||
| mkdir -p "$OUTPUT_DIR" | ||
| mv -f core/target/site/apidocs/* $OUTPUT_DIR | ||
| mv -f "${JAVADOC_FILES[@]}" "$OUTPUT_DIR" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| # sphinx-multiversion runs this script from each temporary checkout. This | ||
| # branch-owned wrapper only selects the Java runtime; the actual Javadocs are | ||
| # still generated by the checkout's own docs/_utils/javadoc.sh so historical | ||
| # refs keep their branch-local docs and Maven configuration. | ||
|
|
||
| version_name="${SPHINX_MULTIVERSION_NAME:-unknown}" | ||
|
|
||
| if [[ "${version_name}" == scylla-* || "${version_name}" == tags/* ]]; then | ||
| if [[ -z "${JAVA_HOME_8_X64:-}" ]]; then | ||
| echo "JAVA_HOME_8_X64 is required to build historical docs for ${version_name}" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| export JAVA_HOME="$JAVA_HOME_8_X64" | ||
| export PATH="$JAVA_HOME/bin:$PATH" | ||
| echo "Using Java 8 for historical docs version ${version_name}" | ||
| elif [[ -n "${JAVA_HOME_11_X64:-}" ]]; then | ||
| export JAVA_HOME="$JAVA_HOME_11_X64" | ||
| export PATH="$JAVA_HOME/bin:$PATH" | ||
| echo "Using Java 11 for ${version_name}" | ||
| fi | ||
|
|
||
| echo "Building Javadocs for ${version_name} with Java:" | ||
| java -version | ||
|
|
||
| bash -e ./docs/_utils/javadoc.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,9 @@ | ||
| #! /bin/bash | ||
| #! /bin/bash | ||
| set -euo pipefail | ||
|
|
||
| cd .. && sphinx-multiversion docs/source docs/_build/dirhtml \ | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)" | ||
|
|
||
| cd "$REPO_ROOT" && sphinx-multiversion docs/source docs/_build/dirhtml \ | ||
| --pre-build "bash -c \"(find . -mindepth 2 -name README.md -execdir mv '{}' index.md ';'; find . -mindepth 2 -name README.rst -execdir mv '{}' index.rst ';')\"" \ | ||
| --post-build './docs/_utils/javadoc.sh' | ||
| --post-build "bash '$SCRIPT_DIR/multiversion-javadoc.sh'" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.