build: order _build/$PROFILE/lib before 'default' profile libs
This commit is contained in:
parent
c15e2f8708
commit
dee21d2ccf
29
build
29
build
|
@ -91,19 +91,18 @@ log() {
|
|||
echo "===< $msg"
|
||||
}
|
||||
|
||||
prepare_erl_libs() {
|
||||
local libs_dir="$1"
|
||||
local erl_libs="${ERL_LIBS:-}"
|
||||
for app in "${libs_dir}"/*; do
|
||||
if [ -d "${app}/ebin" ]; then
|
||||
erl_libs="${erl_libs}:${app}"
|
||||
fi
|
||||
done
|
||||
export ERL_LIBS="$erl_libs"
|
||||
}
|
||||
|
||||
make_docs() {
|
||||
local libs_dir1 libs_dir2 libs_dir3 docdir
|
||||
libs_dir1="$("$FIND" "_build/$PROFILE/lib/" -maxdepth 2 -name ebin -type d)"
|
||||
if [ -d "_build/default/lib/" ]; then
|
||||
libs_dir2="$("$FIND" "_build/default/lib/" -maxdepth 2 -name ebin -type d)"
|
||||
else
|
||||
libs_dir2=''
|
||||
fi
|
||||
if [ -d "_build/$PROFILE/checkouts" ]; then
|
||||
libs_dir3="$("$FIND" "_build/$PROFILE/checkouts/" -maxdepth 2 -name ebin -type d 2>/dev/null || true)"
|
||||
else
|
||||
libs_dir3=''
|
||||
fi
|
||||
case "$(is_enterprise "$PROFILE")" in
|
||||
'yes')
|
||||
SCHEMA_MODULE='emqx_enterprise_schema'
|
||||
|
@ -112,10 +111,12 @@ make_docs() {
|
|||
SCHEMA_MODULE='emqx_conf_schema'
|
||||
;;
|
||||
esac
|
||||
docdir="_build/docgen/$PROFILE"
|
||||
prepare_erl_libs "_build/$PROFILE/checkouts"
|
||||
prepare_erl_libs "_build/$PROFILE/lib"
|
||||
local docdir="_build/docgen/$PROFILE"
|
||||
mkdir -p "$docdir"
|
||||
# shellcheck disable=SC2086
|
||||
erl -noshell -pa $libs_dir1 $libs_dir2 $libs_dir3 -eval \
|
||||
erl -noshell -eval \
|
||||
"ok = emqx_conf:dump_schema('$docdir', $SCHEMA_MODULE), \
|
||||
halt(0)."
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue