Ship the manual with the Arch package, the Windows installer and the APK
The rendered manual was in the repository and nowhere else, so an installed application still had nothing to open. Each packager now carries docs/manual/index.html and its pictures, to where the application will look for them: /usr/share/darkroom/manual on Arch, manual\ beside darkroom.exe on Windows (where the models already are, and where dr_plat::system_data_dirs points), and assets/manual in the APK, stored rather than deflated since a GIF or PNG is already compressed. The manual is about 27 MB, which the APK and the installer both grow by; the pictures are 1600x1100 screenshots and short GIFs, and against an APK that already carries 170 MB of inference runtime and 70 MB of models they are not worth re-encoding for. The pictures are LFS objects, so each packager refuses a pointer where a picture should be, as it already does for the models: shipped, a pointer is a manual of broken images that nothing reports. The Android and Windows CI legs therefore fetch docs/manual/media, which they excluded while nothing they built read it, and the installer smoke test checks that the page and every picture were installed.
This commit is contained in:
@@ -332,6 +332,29 @@ else
|
||||
echo " assets: no models found (face indexing and the scene tab will be off on the device)"
|
||||
fi
|
||||
|
||||
# The manual: the rendered page and its pictures, read in place by
|
||||
# ManualActivity's WebView as file:///android_asset/manual/index.html. Not
|
||||
# unpacked like the models: a WebView reads an asset straight out of the APK,
|
||||
# and relative links to media/ resolve inside the same asset tree, so the page
|
||||
# costs no first-launch copy and no second copy on /data.
|
||||
#
|
||||
# About 27 MB, stored below like the models — a GIF or PNG is already
|
||||
# compressed, and deflating it again buys nothing. The pictures are LFS
|
||||
# objects, and unlike a missing model a pointer would not fail loudly: it
|
||||
# ships as a manual full of broken images. So it stops the build here.
|
||||
rm -rf "${OUT}/staging/assets/manual"
|
||||
mkdir -p "${OUT}/staging/assets/manual/media"
|
||||
cp "${REPO}/docs/manual/index.html" "${OUT}/staging/assets/manual/"
|
||||
for f in "${REPO}/docs/manual/media"/*; do
|
||||
if head -c 40 "${f}" | grep -q '^version https://git-lfs'; then
|
||||
echo "error: $(basename "${f}") is an LFS pointer, not a picture." >&2
|
||||
echo " run: git lfs pull --include='docs/manual/media/**'" >&2
|
||||
exit 1
|
||||
fi
|
||||
cp "${f}" "${OUT}/staging/assets/manual/media/"
|
||||
done
|
||||
echo " manual: index.html and $(ls "${OUT}/staging/assets/manual/media" | wc -l) picture(s), $(du -sh "${OUT}/staging/assets/manual" | cut -f1)"
|
||||
|
||||
# -0 "" stores the .so without compression so Android can mmap it directly
|
||||
# (extractNativeLibs=false territory); for a 37 MB library that also keeps
|
||||
# install times sane.
|
||||
|
||||
@@ -69,6 +69,23 @@ for dir in face scene inpaint; do
|
||||
done
|
||||
echo "==> staged $(ls "${STAGE}/models" | wc -l) model file(s)"
|
||||
|
||||
# The manual: the rendered page and its pictures, beside the executable where
|
||||
# dr_ui::manual looks on Windows (dr_plat::system_data_dirs is the exe's own
|
||||
# directory there). The pictures are LFS objects; a pointer is ~130 bytes of
|
||||
# text that every browser draws as a broken image, so refuse it here rather
|
||||
# than ship a manual with no pictures in it.
|
||||
mkdir -p "${STAGE}/manual/media"
|
||||
cp "${REPO}/docs/manual/index.html" "${STAGE}/manual/"
|
||||
for f in "${REPO}/docs/manual/media"/*; do
|
||||
if head -c 40 "${f}" | grep -q '^version https://git-lfs'; then
|
||||
echo "error: $(basename "${f}") is an LFS pointer, not a picture." >&2
|
||||
echo " run: git lfs pull --include='docs/manual/media/**'" >&2
|
||||
exit 1
|
||||
fi
|
||||
cp "${f}" "${STAGE}/manual/media/"
|
||||
done
|
||||
echo "==> staged the manual and $(ls "${STAGE}/manual/media" | wc -l) picture(s)"
|
||||
|
||||
# One installer in the output directory, the one just built. The directory
|
||||
# is cached between CI runs, so after a version bump a glob over it would find
|
||||
# two and the smoke test would hand Wine both names as one path.
|
||||
|
||||
Reference in New Issue
Block a user