Skip to content

Commit

Permalink
Allow building 27+ docs via ./otp_build download_ex_doc
Browse files Browse the repository at this point in the history
We also make sure to build more stuff in CI to cover more
functionality, and fix a bug where multiple doc targets
couldn't be bit simultaneously

Further info:
- ex_doc is not installed to the post- kerl activation
bin path (nor is it found in the target install folder)
  • Loading branch information
paulo-ferraz-oliveira committed Feb 25, 2024
1 parent fdd1f71 commit d4862b4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
echo '_KERL_PREFIX_GIT=git' >> $GITHUB_ENV
echo '_KERL_PREFIX_GIT_TARGET=https://github.com/erlang/otp.git' >> $GITHUB_ENV
echo 'KERL_BUILD_DOCS=yes' >> $GITHUB_ENV
echo 'KERL_DOC_TARGETS="html chunks"' >> $GITHUB_ENV
_KERL_REL=git
;;
*)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,12 @@ created via `kerl build git...`, and according to `KERL_INSTALL_HTMLDOCS` and `K
Default: `chunks`
Available targets:

- `man`: install manpage docs.
- `man` (dropped in OTP 27): install manpage docs.
- `html`: install HTML docs.
- `pdf`: install PDF docs.
- `pdf` (dropped in OTP 27): install PDF docs.
- `chunks`: install the "chunks" format to get documentation from the `erl` REPL.

You can set multiple type of targets separated by space, example `$KERL_DOC_TARGETS="man html pdf chunks"`
You can set multiple type of targets separated by space, example `KERL_DOC_TARGETS="html chunks"`

#### `KERL_INSTALL_MANPAGES`

Expand Down
17 changes: 14 additions & 3 deletions kerl
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,9 @@ uname_r() {
}

_do_build() {
# $1: release (or git)
# $2: build name

init_build_logfile "$1" "$2"
log_build_entry "*** $(date) - kerl build $1 ***"
log_build_entry "Build options:"
Expand Down Expand Up @@ -1170,12 +1173,20 @@ _do_build() {
fi
if [ -n "$KERL_BUILD_DOCS" ]; then
notice "Building docs..."
OPT_VERSION=$(get_otp_version "$(cat OTP_VERSION)")
if [ "$OPT_VERSION" -ge 27 ]; then
# from OTP 27 on we depend on ex_doc to build the documentation
if ! log_build_cmd "./otp_build download_ex_doc"; then
fail_do_build "download_ex_doc failed." "$2" "$1"
return 1
fi
fi
# shellcheck disable=SC2154 # KERL_DOC_TARGETS is referenced but not assigned
if ! log_build_cmd "make docs DOC_TARGETS=$KERL_DOC_TARGETS"; then
if ! log_build_cmd "make docs DOC_TARGETS=\"$KERL_DOC_TARGETS\""; then
fail_do_build "building docs failed." "$2" "$1"
return 1
fi
if ! log_build_cmd "make release_docs DOC_TARGETS=$KERL_DOC_TARGETS RELEASE_ROOT=$KERL_BUILD_DIR/$2/release_$1"; then
if ! log_build_cmd "make release_docs DOC_TARGETS=\"$KERL_DOC_TARGETS\" RELEASE_ROOT=$KERL_BUILD_DIR/$2/release_$1"; then
fail_do_build "release of docs failed." "$2" "$1"
return 1
fi
Expand Down Expand Up @@ -1697,7 +1708,7 @@ do_install() {
error "couldn't cd into $ERL_TOP."
exit_install
fi
if ! log_install_cmd "ERL_TOP=$ERL_TOP make release_docs DOC_TARGETS=$KERL_DOC_TARGETS RELEASE_ROOT=$absdir"; then
if ! log_install_cmd "ERL_TOP=$ERL_TOP make release_docs DOC_TARGETS=\"$KERL_DOC_TARGETS\" RELEASE_ROOT=$absdir"; then
show_install_logfile "couldn't install docs for Erlang/OTP $rel ($build_name) in $absdir"
exit_install
fi
Expand Down

0 comments on commit d4862b4

Please sign in to comment.