-
Notifications
You must be signed in to change notification settings - Fork 543
CXX-3199 Generate API documentation with generated headers #1301
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
d1a7380
CXX-3199 generate API docs with generated headers
eramongodb 60a3c2e
Use FindDoxygen CMake module to support custom binaries
eramongodb 44cc11e
Replace 'generate-*' Perl scripts with generate-latest-apidocs.sh
eramongodb 3df943e
Remove redundant `-q` flag in favor of `QUIET = YES`
eramongodb 9433918
Remove redundant reference to Doxyfile
eramongodb f7a4834
Merge remote-tracking branch 'upstream/master' into cxx-3199
eramongodb 1e7fd9c
Merge remote-tracking branch 'upstream/master' into cxx-3199
eramongodb 5e8a814
Fix branch name during clone of temp repository
eramongodb ef2d0ef
Update release instructions
eramongodb 2eced3b
Address sheckcheck warning SDC2064
eramongodb 4cc080a
Fix reference to release tags
eramongodb ab9bb47
Reuse generate-latest-apidocs.sh for current API docs
eramongodb 35c0e29
Address discrepancy between GNU and BSD sed
eramongodb 10d4a79
Remove unnecessary docs_target_directory target
eramongodb 969ea5d
Rename docs_source_directory to doxygen-install-headers
eramongodb 97be600
Remove space after `-i` sed flag for GNU sed conformance
eramongodb c02abf1
Fix name of script for doxygen-current
eramongodb c88796b
Update release instructions to account for new Doxygen binary checks
eramongodb 07481f0
Permit incompatible Doxygen binary version with --any-version
eramongodb a03e13a
Convert command line flags into environment variables
eramongodb 4c8155b
Simplify use of environment variables
eramongodb fe04a8e
Fix conditional expression
eramongodb 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# generate-latest-apidocs.sh | ||
# | ||
# Usage: | ||
# ./etc/generate-latest-apidocs.sh | ||
# | ||
# This script is meant to be run from the project root directory. | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
LATEST_VERSION="4.0.0" | ||
DOXYGEN_VERSION_REQUIRED="1.12.0" | ||
|
||
# Permit using a custom Doxygen binary. | ||
: "${DOXYGEN_BINARY:=doxygen}" | ||
|
||
command -v git >/dev/null | ||
command -v mktemp >/dev/null | ||
command -v sed >/dev/null | ||
|
||
if [[ ! -d build ]]; then | ||
echo "missing build directory: this script must be run from the project root directory" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
# Validate Doxygen version. | ||
doxygen_version="$("${DOXYGEN_BINARY:?}" -v | perl -lne 'print $1 if m/^(\d+\.\d+\.\d+).*$/')" | ||
if [[ "${doxygen_version:-}" != "${DOXYGEN_VERSION_REQUIRED:?}" ]]; then | ||
echo "${DOXYGEN_BINARY} version ${doxygen_version:-"unknown"} does not equal ${DOXYGEN_VERSION_REQUIRED:?}" 1>&2 | ||
exit 1 | ||
fi | ||
|
||
working_dir="$(pwd)" | ||
apidocpath="${working_dir:?}/build/docs/api/mongocxx-${LATEST_VERSION:?}" | ||
|
||
# Use a temporary directory for the following operations. | ||
tmpdir="$(mktemp -d)" | ||
trap "rm -rf \"${tmpdir}\"" EXIT | ||
|
||
mkdir -p "${apidocpath:?}" | ||
|
||
# Use a clean copy of the repository. | ||
git clone -q -c advice.detachedHead=false -b "v${LATEST_VERSION}" . "${tmpdir}" | ||
kevinAlbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
cd "${tmpdir:?}" | ||
|
||
# Update the Doxyfile configuration file: | ||
# - set OUTPUT_DIRECTORY to `build/docs/api/mongocxx-<version>`. | ||
# - set PROJECT_NUMBER to `<version>`. | ||
sed -i \ | ||
kevinAlbs marked this conversation as resolved.
Show resolved
Hide resolved
|
||
-e "s|^OUTPUT_DIRECTORY\s*=\s*.*$|OUTPUT_DIRECTORY = ${apidocpath:?}|g" \ | ||
-e "s|^PROJECT_NUMBER\s*=\s*.*$|PROJECT_NUMBER = ${LATEST_VERSION:?}|g" \ | ||
Doxyfile | ||
|
||
# Generate API documentation. | ||
( | ||
set -o xtrace | ||
|
||
cmake -S . -B build -D "DOXYGEN_EXECUTABLE=${DOXYGEN_BINARY:?}" --log-level=WARNING | ||
cmake --build build --target docs_source_directory | ||
"${DOXYGEN_BINARY:?}" | ||
) |
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
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.