Files
horizon-airdef/packaging/package.sh
T
Ludovic Marie a995fd3b46 Prepare with horizon-prepare: launcher, release folders, messages and docs
The launcher prepares a version in-process when it ships the preparer sources
the launcher was built with, with the version's own horizon-prepare when they
differ, and with the Python script only for versions made before it. Release
folders ship horizon-prepare and its sources; resources are reused between
versions with the same preparer. The game's messages, PLAY.txt, the docs and
release builds name horizon-prepare, and tools/prepare_native_client.py is a
wrapper of it for the development tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:29:33 +02:00

28 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# packaging/package.sh BINARY OUTDIR: a playable Horizon folder with the game
# binary, horizon-ctl and horizon-prepare (built beside it: cargo build --release
# -p horizon-client --bins -p horizon-prepare), the exporters horizon-prepare compiles,
# its sources (the launcher compares them to its own), and PLAY.txt.
# It holds none of Minecraft's files: players prepare those from their own copy.
set -euo pipefail
bin=$1
out=$2
repo=$(git -C "$(dirname "$0")" rev-parse --show-toplevel)
rm -rf "$out"
mkdir -p "$out"
git -C "$repo" archive HEAD tools mods/horizon/src/test/java crates/horizon-prepare research-lock.json LICENSE \
| tar -x -C "$out"
cp "$bin" "$out/"
# horizon-ctl, the command line and MCP server that play the game, and horizon-prepare, which
# prepares the resources from the player's own Minecraft, sit beside the client.
for tool in horizon-ctl horizon-prepare; do
path="$(dirname "$bin")/$tool"
case "$bin" in *.exe) path="$path.exe" ;; esac
if [ ! -f "$path" ]; then
echo "package.sh: $path is missing; build it too: cargo build --release -p horizon-client --bins -p horizon-prepare" >&2
exit 1
fi
cp "$path" "$out/"
done
cp "$repo/packaging/PLAY.txt" "$out/PLAY.txt"