Skip to content

Commit

Permalink
Refactor shell scripts into one script that returns target_arch value…
Browse files Browse the repository at this point in the history
… and update Justfile to call it
  • Loading branch information
andresuribe87 committed Aug 7, 2024
1 parent 3e5c926 commit ab0a41b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ setup:
git submodule update --init --recursive
if [[ "$(cargo 2>&1)" == *"rustup could not choose a version of cargo to run"* ]]; then
rustup default 1.78.0
./scripts/setup_case.sh
rustup target add $(./scripts/get_target_arch.sh)
fi

build: setup
Expand All @@ -24,7 +24,7 @@ bind: setup
just bind-kotlin

bind-kotlin: setup
./scripts/bind_kotlin_case.sh
TARGET_ARCH=$(./scripts/get_target_arch.sh)
cargo build --release --package web5_uniffi --target $TARGET_ARCH
cp target/$TARGET_ARCH/release/libweb5_uniffi.* \
bound/kt/src/main/resources/
Expand Down
11 changes: 11 additions & 0 deletions scripts/get_target_arch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
case $(uname -sm) in
"Darwin arm64")
echo "aarch64-apple-darwin" ;;
"Darwin x86_64")
echo "x86_64-apple-darwin" ;;
"Linux aarch64")
echo "aarch64-unknown-linux-gnu" ;;
"Linux x86_64")
echo "x86_64-unknown-linux-gnu" ;;
esac

0 comments on commit ab0a41b

Please sign in to comment.