-
Notifications
You must be signed in to change notification settings - Fork 150
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·78 lines (63 loc) · 2.42 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·78 lines (63 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#! /bin/bash
# Copyright OpenFX and contributors to the OpenFX project.
# SPDX-License-Identifier: BSD-3-Clause
#########################
# Build OFX documentation
#########################
set -e
trap 'catch $? $LINENO' err
catch() {
echo "ERROR code $1 on line $2"
exit 1
}
# Check for prereqs
if [ ! -f genPropertiesReference.py ] ; then
echo "This script must be run in the Documentation directory."
exit 1
fi
if command -v uvx > /dev/null 2>&1; then
USE_UV=1
SPHINX_BUILD="uv run --with-requirements pipreq.txt sphinx-build"
UV_RUN="uv run"
else
USE_UV=
SPHINX_BUILD="sphinx-build"
UV_RUN=""
fi
rm -rf build
# Generate references
EXPECTED_ERRS="unable to resolve reference|explicit link request|found in multiple"
$UV_RUN python genPropertiesReference.py \
-i ../include -o sources/Reference/ofxPropertiesReference.rst -r \
> /tmp/ofx-doc-build.out 2>&1
grep -v -E "$EXPECTED_ERRS" /tmp/ofx-doc-build.out || true
# Generate property documentation from YAML definitions
cd ..
if command -v uv > /dev/null 2>&1; then
uv run scripts/gen-props-doc.py -v >> /tmp/ofx-doc-build.out 2>&1
else
# Fall back to regular python if uv is not available
python scripts/gen-props-doc.py -v >> /tmp/ofx-doc-build.out 2>&1
fi
cd Documentation
# Build the Doxygen docs into $TOP/Documentation/doxygen_build
EXPECTED_ERRS="malformed hyperlink target|Duplicate explicit|Definition list ends|unable to resolve|could not be resolved"
cd ../include
doxygen ofx.doxy > /tmp/ofx-doc-build.out 2>&1
grep -v -E "$EXPECTED_ERRS" /tmp/ofx-doc-build.out || true
cd -
# Use breathe.apidoc to collect the Doxygen API docs
rm -rf sources/Reference/api
if [[ $USE_UV ]]; then
$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
else
python -m breathe.apidoc -p 'ofx_reference' -m --force -g class,interface,struct,union,file,namespace,group -o sources/Reference/api doxygen_build/xml
fi
# Build the Sphinx docs
EXPECTED_ERRS='Explicit markup ends without|Duplicate C.*declaration|Declaration is|cpp:func targets a member|undefined label'
$SPHINX_BUILD -b html sources build > /tmp/ofx-doc-build.out 2>&1
grep -v -E "$EXPECTED_ERRS" /tmp/ofx-doc-build.out || true
echo "Documentation build complete."
echo "Open file:///$PWD/build/index.html in your browser"
echo "to check."
# end of build.sh