blob: 8a15211d724566081b1c0b4da6cfe7e9b74f689f [file] [log] [blame]
#!/bin/bash
set -eufo pipefail
die() {
echo "$0: $*" >&2
exit 1
}
if [[ -z "$FUCHSIA_DIR" ]]; then
die "FUCHSIA_DIR not set"
fi
build_dir_file="$FUCHSIA_DIR/.fx-build-dir"
if ! [[ -f "$build_dir_file" ]]; then
die "$build_dir_file not found"
fi
build_dir="$FUCHSIA_DIR/$(< "$build_dir_file")"
if ! [[ -d "$build_dir" ]]; then
die "$build_dir not found"
fi
zircon_build_dir="${build_dir%/}.zircon"
if ! [[ -d "$zircon_build_dir" ]]; then
die "$zircon_build_dir not found"
fi
cd "$(dirname "$0")"
rm -rf support/
mkdir -p support/{bin,fidl}
cp \
"$build_dir/host_x64/"{fidlc,fidlgen_{llcpp,hlcpp,rust,go,dart}} \
"$zircon_build_dir/tools/fidl-"{format,lint} \
support/bin
find "$FUCHSIA_DIR/sdk/fidl" -mindepth 1 -maxdepth 1 -type d \
| xargs -I% cp -r % support/fidl/
find "$FUCHSIA_DIR/zircon/system/fidl" -mindepth 1 -maxdepth 1 -type d \
| xargs -I% cp -r % support/fidl/