custom-server-mods/scripts/build-all.sh

30 lines
618 B
Bash
Executable file

#!/usr/bin/env bash
# Build every mod with a manifest in mods/.
#
# Usage: ./scripts/build-all.sh [mod-name ...]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck disable=SC1091
source "$SCRIPT_DIR/lib.sh"
check_jdk
if [[ "$#" -gt 0 ]]; then
targets=("$@")
else
mapfile -t targets < <(list_manifests)
fi
if [[ "${#targets[@]}" -eq 0 ]]; then
echo "No manifests found in $MODS_DIR"
exit 0
fi
echo "Building ${#targets[@]} mod(s): ${targets[*]}"
for name in "${targets[@]}"; do
"$SCRIPT_DIR/build-mod.sh" "$name"
done
echo ""
echo "All done. Jars are in $OUT_DIR"