Files
panopainter/scripts/automation/platform-build.sh

30 lines
1020 B
Bash

#!/usr/bin/env sh
set -u
preset="${1:-android-arm64}"
shift || true
targets="${*:-pp_foundation pp_assets pp_paint pano_cli pp_foundation_binary_stream_tests pp_foundation_parse_tests pp_foundation_trace_tests pp_assets_image_format_tests pp_paint_blend_tests}"
start="$(date +%s)"
cmake --preset "$preset"
configure_exit="$?"
if [ "$configure_exit" -ne 0 ]; then
end="$(date +%s)"
elapsed_ms="$(( (end - start) * 1000 ))"
printf '{"command":"platform-build","preset":"%s","stage":"configure","exitCode":%s,"elapsedMs":%s}\n' "$preset" "$configure_exit" "$elapsed_ms"
exit "$configure_exit"
fi
build_args=""
for target in $targets; do
build_args="$build_args --target $target"
done
# shellcheck disable=SC2086
cmake --build --preset "$preset" $build_args
build_exit="$?"
end="$(date +%s)"
elapsed_ms="$(( (end - start) * 1000 ))"
printf '{"command":"platform-build","preset":"%s","targets":"%s","exitCode":%s,"elapsedMs":%s}\n' "$preset" "$targets" "$build_exit" "$elapsed_ms"
exit "$build_exit"