mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-10 12:32:45 +00:00
doc: update doc generation tooling to only work within the $BUILDDIR
Modify the documentation Makefile (doc/Makefile) and scripts to only modify and create content inside the $BUILDDIR folder. The folders that were created inside 'doc/' previously are now all created inside '$BUILDDIR/rst'. The '.gitignore' file has also been updated accordingly. Tracked-On: #3686 Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
parent
0dac373d93
commit
1794d994b6
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,7 +1,4 @@
|
|||||||
doc/doxygen
|
|
||||||
doc/_build
|
doc/_build
|
||||||
doc/reference/kconfig/*.rst
|
|
||||||
doc/misc
|
|
||||||
build
|
build
|
||||||
*.bak
|
*.bak
|
||||||
*.sav
|
*.sav
|
||||||
|
37
doc/Makefile
37
doc/Makefile
@ -11,8 +11,8 @@ endif
|
|||||||
SPHINXOPTS ?= -q
|
SPHINXOPTS ?= -q
|
||||||
SPHINXBUILD = sphinx-build
|
SPHINXBUILD = sphinx-build
|
||||||
SPHINXPROJ = "Project ACRN"
|
SPHINXPROJ = "Project ACRN"
|
||||||
SOURCEDIR = .
|
|
||||||
BUILDDIR ?= _build
|
BUILDDIR ?= _build
|
||||||
|
SOURCEDIR = $(BUILDDIR)/rst/
|
||||||
|
|
||||||
# document publication assumes the folder structure is setup
|
# document publication assumes the folder structure is setup
|
||||||
# with the acrn-hypervisor and projectacrn.github.io repos as
|
# with the acrn-hypervisor and projectacrn.github.io repos as
|
||||||
@ -33,40 +33,47 @@ help:
|
|||||||
@echo " specify RELEASE=name to publish as a tagged release version"
|
@echo " specify RELEASE=name to publish as a tagged release version"
|
||||||
@echo " and placed in a version subfolder. Requires repo merge permission."
|
@echo " and placed in a version subfolder. Requires repo merge permission."
|
||||||
|
|
||||||
.PHONY: help Makefile
|
.PHONY: help Makefile copy-to-sourcedir doxy content kconfig html singlehtml clean publish
|
||||||
|
|
||||||
# Generate the doxygen xml (for Sphinx) and copy the doxygen html to the
|
# Generate the doxygen xml (for Sphinx) and copy the doxygen html to the
|
||||||
# api folder for publishing along with the Sphinx-generated API docs.
|
# api folder for publishing along with the Sphinx-generated API docs.
|
||||||
|
|
||||||
doxy:
|
copy-to-sourcedir:
|
||||||
$(Q)(cat acrn.doxyfile) | doxygen - > doc.log 2>&1
|
$(Q)mkdir -p $(SOURCEDIR)
|
||||||
$(Q)find doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
|
$(Q)rsync -rt --exclude=$(BUILDDIR) . $(SOURCEDIR)
|
||||||
|
|
||||||
content:
|
doxy: copy-to-sourcedir
|
||||||
$(Q)scripts/extract_content.py . misc
|
$(Q)(cat acrn.doxyfile ; echo "OUTPUT_DIRECTORY=$(SOURCEDIR)/doxygen" ) | doxygen - > $(BUILDDIR)/doc.log 2>&1
|
||||||
|
$(Q)find $(SOURCEDIR)/doxygen/xml/* | xargs sed -i 's/simplesect kind="pre"/simplesect kind="preconditions"/'
|
||||||
|
|
||||||
kconfig:
|
content: copy-to-sourcedir
|
||||||
|
$(Q)scripts/extract_content.py $(SOURCEDIR) misc
|
||||||
|
|
||||||
|
kconfig: copy-to-sourcedir
|
||||||
$(Q)srctree=../hypervisor \
|
$(Q)srctree=../hypervisor \
|
||||||
python3 scripts/genrest.py Kconfig reference/kconfig/
|
python3 scripts/genrest.py Kconfig $(SOURCEDIR)/reference/kconfig/
|
||||||
|
|
||||||
pullsource:
|
pullsource:
|
||||||
$(Q)scripts/pullsource.sh
|
$(Q)scripts/pullsource.sh
|
||||||
|
|
||||||
html: doxy content kconfig
|
html: copy-to-sourcedir doxy content kconfig
|
||||||
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
|
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b html -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> $(BUILDDIR)/doc.log 2>&1
|
||||||
$(Q)./scripts/filter-doc-log.sh doc.log
|
$(Q)./scripts/filter-doc-log.sh $(BUILDDIR)/doc.log
|
||||||
|
|
||||||
singlehtml: doxy content kconfig
|
singlehtml: doxy content kconfig
|
||||||
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b singlehtml -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> doc.log 2>&1
|
-$(Q)$(SPHINXBUILD) -t $(DOC_TAG) -b singlehtml -d $(BUILDDIR)/doctrees $(SOURCEDIR) $(BUILDDIR)/html $(SPHINXOPTS) $(OPTS) >> $(BUILDDIR)/doc.log 2>&1
|
||||||
$(Q)./scripts/filter-doc-log.sh doc.log
|
$(Q)./scripts/filter-doc-log.sh $(BUILDDIR)/doc.log
|
||||||
|
|
||||||
# Remove generated content (Sphinx and doxygen)
|
# Remove generated content (Sphinx and doxygen)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(BUILDDIR) doxygen
|
rm -fr $(BUILDDIR)
|
||||||
|
# Keeping these temporarily, but no longer strictly needed.
|
||||||
|
rm -fr doxygen
|
||||||
rm -fr misc
|
rm -fr misc
|
||||||
rm -fr reference/kconfig/*.rst
|
rm -fr reference/kconfig/*.rst
|
||||||
|
|
||||||
|
|
||||||
# Copy material over to the GitHub pages staging repo
|
# Copy material over to the GitHub pages staging repo
|
||||||
# along with a README
|
# along with a README
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ KI_SCRIPT=scripts/filter-known-issues.py
|
|||||||
CONFIG_DIR=.known-issues/doc
|
CONFIG_DIR=.known-issues/doc
|
||||||
|
|
||||||
LOG_FILE=$1
|
LOG_FILE=$1
|
||||||
|
BUILDDIR=$(dirname $LOG_FILE)
|
||||||
|
|
||||||
if [ -z "${LOG_FILE}" ]; then
|
if [ -z "${LOG_FILE}" ]; then
|
||||||
echo "Error in $0: missing input parameter <logfile>"
|
echo "Error in $0: missing input parameter <logfile>"
|
||||||
@ -29,7 +30,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -s "${LOG_FILE}" ]; then
|
if [ -s "${LOG_FILE}" ]; then
|
||||||
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > doc.warnings 2>&1
|
$KI_SCRIPT --config-dir ${CONFIG_DIR} ${LOG_FILE} > ${BUILDDIR}/doc.warnings 2>&1
|
||||||
if [ -s doc.warnings ]; then
|
if [ -s doc.warnings ]; then
|
||||||
echo
|
echo
|
||||||
echo -e "${red}New errors/warnings found, please fix them:"
|
echo -e "${red}New errors/warnings found, please fix them:"
|
||||||
|
Loading…
Reference in New Issue
Block a user