2023-08-07 18:51:45 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2023-08-07 19:21:48 +00:00
|
|
|
RUST_ALL_TARGETS="dashboard ifc memorycache geo-types fluent-ergonomics"
|
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-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
|
|
|
|
CMD="release"
|
|
|
|
fi
|
|
|
|
|
2023-08-07 19:14:14 +00:00
|
|
|
if [ "${TARGET}" == "all" ]; then
|
|
|
|
build_rust_targets $CMD $RUST_ALL_TARGETS
|
|
|
|
else
|
|
|
|
build_rust_targets $CMD $TARGET
|
|
|
|
fi
|