@@ -3,17 +3,18 @@ set -euo pipefail
33
44root_path=$( git rev-parse --show-toplevel)
55
6- git clone --depth=1 --branch sdk-bindings --single-branch https://github.com/iotaledger/iota-rust-sdk.git " $root_path /clients/bindings/iota-rust-sdk" || true
6+ # use commit b921ab3e65acbe377cd4da0ec6d8421fecc15ad8
7+ # git clone --branch modify-sdk --single-branch git@github.com:howjmay/iota-rust-sdk.git "$root_path/clients/bindings/iota-rust-sdk" || true
8+ # cd $root_path/clients/bindings/iota-rust-sdk
9+ # git switch --detach b921ab3e65acbe377cd4da0ec6d8421fecc15ad8
10+ # cd ..
711
812iota_binding_dir=" $root_path /clients/bindings"
913iota_go_ffi_dir=" $iota_binding_dir /iota_sdk_ffi"
1014iota_go_ffi_file=" $iota_go_ffi_dir /iota_sdk_ffi.go"
1115
1216iota_rust_sdk_path=" $iota_binding_dir /iota-rust-sdk"
13- go_ffi_dir=" $iota_rust_sdk_path /bindings/go/iota_sdk_ffi/iota_sdk_ffi"
14- go_ffi_file=" $go_ffi_dir /iota_sdk_ffi.go"
15-
16- go_ffi_target_dir=" $root_path /clients/bindings/iota-rust-sdk/target"
17+ iota_rust_go_ffi_dir=" $iota_rust_sdk_path /bindings/go/iota_sdk_ffi"
1718
1819cd " $iota_rust_sdk_path "
1920cargo build --all-features -p iota-sdk-ffi --lib --release
@@ -27,20 +28,20 @@ case "$(uname -s)" in
2728esac
2829lib_path=" ${lib_base} .${ext} "
2930
30- command -v uniffi-bindgen-go > /dev/null || {
31- echo " uniffi-bindgen-go not found in PATH" >&2
32- exit 1
33- }
3431[[ -f " $lib_path " ]] || {
3532echo " Library not found: $lib_path " >&2
3633exit 1
3734}
3835
39- # Clean up old generated files before generating new ones
40- rm -rf " $root_path /clients/bindings/iota_sdk_ffi"
41-
42- uniffi-bindgen-go --library " $lib_path " --out-dir " $iota_binding_dir " --no-format
43- echo " Generated Go bindings to $iota_binding_dir using $lib_path "
36+ # Overwrite local Go FFI bindings with those from iota-rust-sdk
37+ rm -rf " $iota_go_ffi_dir "
38+ if [[ -d " $iota_rust_go_ffi_dir " ]]; then
39+ cp -R " $iota_rust_go_ffi_dir " " $iota_binding_dir /"
40+ echo " Copied Go bindings from $iota_rust_go_ffi_dir to $iota_binding_dir "
41+ else
42+ echo " Source bindings not found: $iota_rust_go_ffi_dir " >&2
43+ exit 1
44+ fi
4445
4546if [[ -f " $iota_go_ffi_file " ]]; then
4647 # Only replace if the placeholder include line exists
5859 echo " File not found: $iota_go_ffi_file " >&2
5960 exit 1
6061fi
61-
62-
63- # cp -R $go_ffi_target_dir $root_path/clients/bindings/iota_sdk_ffi
64-
65-
66-
0 commit comments