From e944d5478cde3fac098a639ea67b948ade326a47 Mon Sep 17 00:00:00 2001 From: Flux Date: Sat, 11 Jan 2025 12:39:51 +0200 Subject: [PATCH] added target dep installation --- rust_to_flutter.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rust_to_flutter.sh b/rust_to_flutter.sh index 5c193a3..42bbc94 100644 --- a/rust_to_flutter.sh +++ b/rust_to_flutter.sh @@ -27,6 +27,26 @@ fi # Enter the Rust project folder cd "$RUST_PROJECT_FOLDER" || exit + +# Function to check and install missing targets +install_missing_targets() { + for target in "${@}"; do + if ! rustup target list --installed | grep -q "$target"; then + echo "Installing target: $target" + rustup target add "$target" + else + echo "Target already installed: $target" + fi + done +} + +# Install required targets +install_missing_targets "${ANDROID_TARGETS[@]}" +if [ "$INCLUDE_IOS_TARGETS" = true ]; then + install_missing_targets "${IOS_TARGETS[@]}" +fi + +# Cleanup echo "Cleaning Build Directory" cargo clean