@@ -22,37 +22,44 @@ if [ ! -f genPropertiesReference.py ] ; then
2222 exit 1
2323fi
2424
25- if ! command -v sphinx-build > /dev/null 2>&1 ; then
26- echo " Python can't import required modules; did you set up the prereqs?"
27- echo " Check the README.md."
28- exit 1
25+ if command -v uvx > /dev/null 2>&1 ; then
26+ USE_UV=1
27+ SPHINX_BUILD=" uv run --with-requirements pipreq.txt sphinx-build"
28+ UV_RUN=" uv run"
29+ else
30+ USE_UV=
31+ SPHINX_BUILD=" sphinx-build"
32+ UV_RUN=" "
2933fi
3034
3135rm -rf build
3236
3337# Generate references
3438EXPECTED_ERRS=" unable to resolve reference|explicit link request|found in multiple"
35- python genPropertiesReference.py \
39+ $UV_RUN python genPropertiesReference.py \
3640 -i ../include -o sources/Reference/ofxPropertiesReference.rst -r \
3741 > /tmp/ofx-doc-build.out 2>&1
38- egrep -v " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
42+ grep -v -E " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
3943
4044# Build the Doxygen docs
4145EXPECTED_ERRS=" malformed hyperlink target|Duplicate explicit|Definition list ends|unable to resolve|could not be resolved"
4246cd ../include
4347doxygen ofx.doxy > /tmp/ofx-doc-build.out 2>&1
44- egrep -v " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
48+ grep -v -E " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
4549cd -
4650
4751# Use breathe.apidoc to collect the Doxygen API docs
4852rm -rf sources/Reference/api
49- python -m breathe.apidoc -p ' ofx_reference' -m --force -g class,interface,struct,union,file,namespace,group -o sources/Reference/api doxygen_build/xml
50-
53+ if [[ $USE_UV ]]; then
54+ $UV_RUN --with breathe python -m breathe.apidoc -p ' ofx_reference' -m --force -g class,interface,struct,union,file,namespace,group -o sources/Reference/api doxygen_build/xml
55+ else
56+ python -m breathe.apidoc -p ' ofx_reference' -m --force -g class,interface,struct,union,file,namespace,group -o sources/Reference/api doxygen_build/xml
57+ fi
5158
5259# Build the Sphinx docs
5360EXPECTED_ERRS=' Explicit markup ends without|Duplicate C.*declaration|Declaration is|cpp:func targets a member|undefined label'
54- sphinx-build -b html sources build > /tmp/ofx-doc-build.out 2>&1
55- egrep -v " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
61+ $SPHINX_BUILD -b html sources build > /tmp/ofx-doc-build.out 2>&1
62+ grep -v -E " $EXPECTED_ERRS " /tmp/ofx-doc-build.out || true
5663
5764echo " Documentation build complete."
5865echo " Open file:///$PWD /build/index.html in your browser"
0 commit comments