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

Docs: enable readthedocs rendering (for PRs) #256

Merged
merged 2 commits into from
Oct 10, 2023
Merged
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
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2
formats: all
build:
os: "ubuntu-22.04"
tools:
python: "3.10"
apt_packages:
- cmake
- libhugetlbfs-dev
- libsysfs-dev
# here it would be nice to tell them that the conf.py will be in openamp-docs/conf.py
# sphinx:
# configuration: openamp-docs/conf.py
# HOWEVER, if we say this they check right after they do checkout and it does not exist yet
# As of now they find it well enough right before the build stage
jobs:
post_checkout:
# we ignore the checkout they did and make a new one of the whole openamp-docs project
- env
- git log -n 1 --oneline
- git rev-parse HEAD
- git clone --recurse-submodules https://github.com/OpenAMP/openamp-docs.git
# now adjust the focused submodule to the PR in progress
- echo "URL=${READTHEDOCS_GIT_CLONE_URL} COMMIT=${READTHEDOCS_GIT_COMMIT_HASH}"
- (cd openamp-docs/libmetal; git remote add this_pr ${READTHEDOCS_GIT_CLONE_URL}; git fetch this_pr )
- (cd openamp-docs/libmetal; git checkout $(cd ../..; git rev-parse HEAD) )
- (cd openamp-docs/libmetal; git log -n 1 --oneline)
- (cd openamp-docs; git submodule status)
post_install:
- python -m pip install --exists-action=w --no-cache-dir -r openamp-docs/requirements.txt
pre_build:
- echo "READTHEDOCS_OUTPUT=$READTHEDOCS_OUTPUT"
- make -C openamp-docs BUILDDIR=$READTHEDOCS_OUTPUT doxygen
post_build:
- make -C openamp-docs BUILDDIR=$READTHEDOCS_OUTPUT doxygen_copy
22 changes: 17 additions & 5 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
if (DOXYGEN_FOUND)

configure_file (Doxyfile.in Doxyfile @ONLY)
if (EXISTS ${CMAKE_SOURCE_DIR}/../_doxygen/openamp/Doxyfile-openamp.in)
set (OAMP_DOX_DIR ${CMAKE_SOURCE_DIR}/../_doxygen/openamp)
configure_file (Doxyfile.in Doxyfile1 @ONLY)
configure_file (${OAMP_DOX_DIR}/Doxyfile-openamp.in Doxyfile2 @ONLY)

add_custom_target (doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target (doc ALL
COMMAND cat Doxyfile1 Doxyfile2 >Doxyfile
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
else ()
configure_file (Doxyfile.in Doxyfile @ONLY)

add_custom_target (doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif ()

install (DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
DESTINATION share/doc/${PROJECT_NAME})
Expand Down