gstreamer/ci/scripts/build-docs.sh
Jordan Petridis 9c5523d529 ci: Make it easier to run the build scripts locally
* Move the exported PATH variables into a script so
we can source it in all the wrapper scripts.

* Add a guard to only copy over the cache when the
SUBPROJECTS_CACHE_DIR variable is set, which only
happens on CI by default

* Make it possible to run the scripts with default
values for some of the variables, like WERROR and MESON_ARGS.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7591>
2024-10-28 13:47:18 +00:00

32 lines
893 B
Bash
Executable file

#! /bin/bash
builddir="$1"
if [[ -z "$builddir" ]]; then
echo "Usage: build-docs.sh <build_directory>"
exit 1
fi
set -eux
source "ci/scripts/source_image_env.sh"
meson_args="${MESON_ARGS:--Ddoc=enabled -Drs=enabled -Dgst-docs:fatal_warnings=true}"
echo "$meson_args"
meson setup "$builddir" $meson_args
ccache --show-stats
ninja -C "$builddir" update_girs
# Ignore modifications to wrap files made by meson
git checkout $(git ls-files 'subprojects/*.wrap')
./ci/scripts/check-diff.py "gir files"
./gst-env.py --builddir "$builddir" ninja -C "$builddir" plugins_doc_caches
# Ignore modifications to wrap files made by meson
git checkout $(git ls-files 'subprojects/*.wrap')
./ci/scripts/check-diff.py
export GI_TYPELIB_PATH="$PWD/girs"
hotdoc run --conf-file "$builddir/subprojects/gst-docs/GStreamer-doc.json"
mv "$builddir/subprojects/gst-docs/GStreamer-doc/html" documentation/