Files
AniCraft/examples/plugins/build.sh
T

15 lines
666 B
Bash
Executable File
Raw 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.
#!/bin/sh
# Builds the sample plug-ins to WebAssembly (docs/plugins.md) and copies them to ./dist.
# Needs the wasm32-unknown-unknown target: `rustup target add wasm32-unknown-unknown`.
# Install one with Commands › Install Plug-in…, or try them headless:
# anicraft-cli exec --sample plugin.reload '{"folder": "examples/plugins/dist"}'
set -eu
cd "$(dirname "$0")"
cargo build --release --target wasm32-unknown-unknown
out="${CARGO_TARGET_DIR:-target}/wasm32-unknown-unknown/release"
mkdir -p dist
for name in star_field jitter; do
cp "$out/anicraft_plugin_$name.wasm" "dist/$name.wasm"
echo "dist/$name.wasm: $(wc -c < "dist/$name.wasm") bytes"
done