#!/usr/bin/env bash # Build the mod against all supported MC versions and collect jars under build/multiver/. # Uses gradle property overrides so we don't have to maintain three settings.gradle copies. set -euo pipefail cd "$(dirname "$0")/.." OUT=build/multiver rm -rf "$OUT" mkdir -p "$OUT" build_one() { local mc="$1" yarn="$2" fab="$3" echo "==> Building for MC $mc (yarn=$yarn, fabric-api=$fab)" ./gradlew --no-daemon \ -Pminecraft_version="$mc" \ -Pyarn_mappings="$yarn" \ -Pfabric_version="$fab" \ build # main jar = the one without "-sources" local jar jar=$(ls build/libs/video_player-*.jar | grep -v -- '-sources' | head -1) cp "$jar" "$OUT/video_player-mc${mc}.jar" } build_one 1.21.6 1.21.6+build.1 0.120.1+1.21.6 build_one 1.21.7 1.21.7+build.8 0.129.0+1.21.7 build_one 1.21.8 1.21.8+build.1 0.136.1+1.21.8 echo echo "All jars:" ls -la "$OUT"