2023-08-07 18:51:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-08-07 20:20:18 +00:00
|
|
|
RUST_ALL_TARGETS=(
|
2023-08-16 03:53:00 +00:00
|
|
|
"changeset"
|
|
|
|
"config"
|
2023-08-16 04:35:11 +00:00
|
|
|
"config-derive"
|
2023-08-16 03:53:00 +00:00
|
|
|
"coordinates"
|
|
|
|
"cyberpunk-splash"
|
2023-08-07 20:20:18 +00:00
|
|
|
"dashboard"
|
2023-08-16 03:53:00 +00:00
|
|
|
"emseries"
|
2023-09-19 23:01:09 +00:00
|
|
|
"file-service"
|
2023-08-16 03:53:00 +00:00
|
|
|
"fluent-ergonomics"
|
|
|
|
"geo-types"
|
2023-08-15 12:45:08 +00:00
|
|
|
"gm-control-panel"
|
2023-08-16 03:53:00 +00:00
|
|
|
"hex-grid"
|
2023-08-07 20:20:18 +00:00
|
|
|
"ifc"
|
2023-08-10 23:53:20 +00:00
|
|
|
"kifu-core"
|
|
|
|
"kifu-gtk"
|
2023-08-07 20:20:18 +00:00
|
|
|
"memorycache"
|
2023-10-19 02:03:43 +00:00
|
|
|
"nom-training"
|
|
|
|
"result-extended"
|
2023-08-07 20:20:18 +00:00
|
|
|
"screenplay"
|
|
|
|
"sgf"
|
2023-10-20 22:32:43 +00:00
|
|
|
"tree"
|
2023-08-07 20:20:18 +00:00
|
|
|
)
|
2023-08-07 19:14:14 +00:00
|
|
|
|
|
|
|
build_rust_targets() {
|
|
|
|
local CMD=$1
|
|
|
|
local TARGETS=${@/$CMD}
|
|
|
|
|
|
|
|
for target in $TARGETS; do
|
|
|
|
MODULE=$target CMD=$CMD ./builders/rust.sh
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2023-08-18 00:54:05 +00:00
|
|
|
build_dist() {
|
|
|
|
local TARGETS=${@/$CMD}
|
|
|
|
|
|
|
|
for target in $TARGETS; do
|
|
|
|
if [ -f $target/dist.sh ]; then
|
2023-10-05 16:30:18 +00:00
|
|
|
build_rust_targets release ${TARGETS[*]}
|
2023-08-18 00:54:05 +00:00
|
|
|
cd $target && ./dist.sh
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2023-08-07 18:51:45 +00:00
|
|
|
export CARGO=`which cargo`
|
|
|
|
|
|
|
|
if [ -z "${TARGET-}" ]; then
|
2023-08-07 19:14:14 +00:00
|
|
|
TARGET="all"
|
2023-08-07 18:51:45 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "${CMD-}" ]; then
|
2023-08-07 22:34:02 +00:00
|
|
|
CMD="test release"
|
2023-08-07 18:51:45 +00:00
|
|
|
fi
|
|
|
|
|
2023-08-07 20:20:18 +00:00
|
|
|
if [ "${CMD}" == "clean" ]; then
|
|
|
|
cargo clean
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-08-07 22:34:02 +00:00
|
|
|
for cmd in $CMD; do
|
2023-08-18 00:54:05 +00:00
|
|
|
if [ "${CMD}" == "dist" ]; then
|
|
|
|
build_dist $TARGET
|
|
|
|
elif [ "${TARGET}" == "all" ]; then
|
2023-08-07 22:34:02 +00:00
|
|
|
build_rust_targets $cmd ${RUST_ALL_TARGETS[*]}
|
|
|
|
else
|
|
|
|
build_rust_targets $cmd $TARGET
|
|
|
|
fi
|
|
|
|
done
|