Skip to content

Commit e007019

Browse files
committed
docs: Disable warnings as errors if any app has not been built
We do this as ExDoc does a lot of link checking that most likely will cause warnings when an app is not built.
1 parent 85f11dd commit e007019

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

make/doc.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ DEFAULT_DOC_TARGETS+=man
6464
endif
6565
DOC_TARGETS?=$(DEFAULT_DOC_TARGETS)
6666

67-
EX_DOC_WARNINGS_AS_ERRORS?=true
67+
EX_DOC_WARNINGS_AS_ERRORS?=default
6868

6969
docs: $(DOC_TARGETS)
7070

make/ex_doc_wrapper.in

+11
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ OUTPUT="$( { escript@EXEEXT@ "${EX_DOC}" "${ARGS[@]}"; } 2>&1 1>&3 | tee /dev/fd
4040
## Close fd 3 and 4
4141
exec 3>&- 4>&-
4242

43+
set -x
44+
## If EX_DOC_WARNINGS_AS_ERRORS is not explicitly turned on
45+
## and any .app file is missing, we turn off warnings as errors
46+
if [ "${EX_DOC_WARNINGS_AS_ERRORS}" != "true" ]; then
47+
for app in $ERL_TOP/lib/*/; do
48+
if [ ! -f $app/ebin/*.app ]; then
49+
EX_DOC_WARNINGS_AS_ERRORS=false
50+
fi
51+
done
52+
fi
53+
4354
if [ "${EX_DOC_WARNINGS_AS_ERRORS}" != "false" ]; then
4455
if echo "${OUTPUT}" | grep "warning:" 1>/dev/null; then
4556
echo "ex_doc emitted warnings"

0 commit comments

Comments
 (0)