added target dep installation

This commit is contained in:
Flux 2025-01-11 12:39:51 +02:00 committed by GitHub
parent 114bc84387
commit e944d5478c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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