Files
MapLibreParticleLab/工具/完整构建验证.sh
OpenAI Codex ea5b8f9d7f
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
chore: freeze MapLibreParticleLab step 0 baseline
2026-08-28 16:38:16 +08:00

63 lines
1.5 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -Eeuo pipefail
JOBS=3
while [[ $# -gt 0 ]]; do
case "$1" in
--jobs) JOBS="$2"; shift 2 ;;
*) echo "未知参数:$1"; exit 2 ;;
esac
done
ROOT="$(git rev-parse --show-toplevel)"
cd "$ROOT"
mkdir -p build-particle
REPORT="build-particle/构建验证报告.txt"
: > "$REPORT"
exec > >(tee -a "$REPORT") 2>&1
# 环境文件内部会安全处理 nvm + nounset。
if [[ -f "$HOME/.maplibre-particle-env" ]]; then
# shellcheck disable=SC1090
source "$HOME/.maplibre-particle-env"
fi
export CMAKE_BUILD_PARALLEL_LEVEL="$JOBS"
export CTEST_PARALLEL_LEVEL="$JOBS"
echo "=== MapLibreParticleLab 完整构建验证 ==="
echo "HEAD:$(git rev-parse HEAD)"
echo "并行度:$JOBS"
echo "Node:$(node -v)"
echo "npm:$(npm -v)"
echo "Java:$(java -version 2>&1 | head -n1)"
echo
echo "[1/3] Linux OpenGL"
cmake --preset linux-opengl
cmake --build build-linux-opengl --target mbgl-render mbgl-render-test-runner -j "$JOBS"
echo
echo "[2/3] Android OpenGL Debug"
(
cd "$ROOT/platform/android"
RENDERER=opengl BUILDTYPE=Debug JOBS="$JOBS" make apackage
)
echo
echo "[3/3] Android Vulkan Debug"
(
cd "$ROOT/platform/android"
RENDERER=vulkan BUILDTYPE=Debug JOBS="$JOBS" make apackage
)
cd "$ROOT"
sed -i \
's/- \[ \] Linux Native 构建/- [x] Linux Native 构建/; s/- \[ \] Android OpenGL 构建/- [x] Android OpenGL 构建/; s/- \[ \] Android Vulkan 构建/- [x] Android Vulkan 构建/' \
docs/50_Step记录/STEP-000_完整环境初始化_v1.md 2>/dev/null || true
echo
echo "全部构建验证完成。"