monorepo/build.sh

54 lines
835 B
Bash
Raw Normal View History

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-10 23:53:20 +00:00
"changeset"
"coordinates"
"cyberpunk-splash"
2023-08-07 20:20:18 +00:00
"dashboard"
2023-08-10 23:53:20 +00:00
"emseries"
"flow"
"fluent-ergonomics"
"geo-types"
"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"
"screenplay"
"sgf"
)
build_rust_targets() {
local CMD=$1
local TARGETS=${@/$CMD}
for target in $TARGETS; do
MODULE=$target CMD=$CMD ./builders/rust.sh
done
}
2023-08-07 18:51:45 +00:00
export CARGO=`which cargo`
if [ -z "${TARGET-}" ]; then
TARGET="all"
2023-08-07 18:51:45 +00:00
fi
if [ -z "${CMD-}" ]; then
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
for cmd in $CMD; do
if [ "${TARGET}" == "all" ]; then
build_rust_targets $cmd ${RUST_ALL_TARGETS[*]}
else
build_rust_targets $cmd $TARGET
fi
done