diff --git a/crates/bitwarden-uniffi/kotlin/publish-local.sh b/crates/bitwarden-uniffi/kotlin/publish-local.sh index 3f77e3b7..a96c0ede 100755 --- a/crates/bitwarden-uniffi/kotlin/publish-local.sh +++ b/crates/bitwarden-uniffi/kotlin/publish-local.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash -set -e +set -eo pipefail cd "$(dirname "$0")" + SDK_REPO_ROOT="$(git rev-parse --show-toplevel)" mkdir -p ./sdk/src/main/jniLibs/{arm64-v8a,armeabi-v7a,x86_64,x86} @@ -10,8 +11,22 @@ mkdir -p ./sdk/src/main/jniLibs/{arm64-v8a,armeabi-v7a,x86_64,x86} cross build -p bitwarden-uniffi --release --target=aarch64-linux-android mv $SDK_REPO_ROOT/target/aarch64-linux-android/release/libbitwarden_uniffi.so ./sdk/src/main/jniLibs/arm64-v8a/libbitwarden_uniffi.so +# Build other archs +if [ $1 = "all" ]; then + echo "Building for all architectures" + + cross build -p bitwarden-uniffi --release --target=armv7-linux-androideabi + mv $SDK_REPO_ROOT/target/armv7-linux-androideabi/release/libbitwarden_uniffi.so ./sdk/src/main/jniLibs/armeabi-v7a/libbitwarden_uniffi.so + + cross build -p bitwarden-uniffi --release --target=x86_64-linux-android + mv $SDK_REPO_ROOT/target/x86_64-linux-android/release/libbitwarden_uniffi.so ./sdk/src/main/jniLibs/x86_64/libbitwarden_uniffi.so + + cross build -p bitwarden-uniffi --release --target=i686-linux-android + mv $SDK_REPO_ROOT/target/i686-linux-android/release/libbitwarden_uniffi.so ./sdk/src/main/jniLibs/x86/libbitwarden_uniffi.so +fi + # Generate latest bindings ./build-schemas.sh -# Publish to local maven +# Publish to local maven (~/.m2/repository/com/bitwarden/sdk-android) ./gradlew sdk:publishToMavenLocal -Pversion=LOCAL diff --git a/crates/bitwarden-uniffi/swift/build.sh b/crates/bitwarden-uniffi/swift/build.sh index 10ff4a41..a19395c8 100755 --- a/crates/bitwarden-uniffi/swift/build.sh +++ b/crates/bitwarden-uniffi/swift/build.sh @@ -1,3 +1,8 @@ +#!/usr/bin/env bash +set -eo pipefail + +cd "$(dirname "$0")" + # Generate an xcframework for the Swift bindings. # Cleanup dirs diff --git a/crates/bitwarden-wasm-internal/build.sh b/crates/bitwarden-wasm-internal/build.sh index ffd5a70b..3a0c266c 100755 --- a/crates/bitwarden-wasm-internal/build.sh +++ b/crates/bitwarden-wasm-internal/build.sh @@ -1,5 +1,9 @@ -# Move to the root of the repository +#!/usr/bin/env bash +set -eo pipefail + cd "$(dirname "$0")" + +# Move to the root of the repository cd ../../ if [ "$1" != "-r" ]; then diff --git a/crates/memory-testing/Dockerfile b/crates/memory-testing/Dockerfile index 90ac2cb8..1a6328b8 100644 --- a/crates/memory-testing/Dockerfile +++ b/crates/memory-testing/Dockerfile @@ -11,7 +11,7 @@ COPY crates/bitwarden-crypto/Cargo.toml /app/crates/bitwarden-crypto/ COPY crates/memory-testing/Cargo.toml /app/crates/memory-testing/ # Patch Cargo.toml to remove `, "bitwarden_license/*"` from the members array -RUN sed -i 's/, "bitwarden_license\/\*"\(,\?\)/\1/' Cargo.toml +RUN sed -i 's/\([" ]*\)"bitwarden_license\/\*"[ ,]*\([" ]*\)/\1\2/g' Cargo.toml RUN mkdir -p /app/crates/bitwarden-crypto/src \ /app/crates/bitwarden-crypto/benches \ diff --git a/crates/memory-testing/run_test.sh b/crates/memory-testing/run_test.sh index c9b5e375..8d329a9b 100755 --- a/crates/memory-testing/run_test.sh +++ b/crates/memory-testing/run_test.sh @@ -1,7 +1,9 @@ +#!/usr/bin/env bash set -eo pipefail -# Move to the root of the repository cd "$(dirname "$0")" + +# Move to the root of the repository cd ../../ BASE_DIR="./crates/memory-testing" diff --git a/support/build-api.sh b/support/build-api.sh index 05650fd3..e45c4c29 100755 --- a/support/build-api.sh +++ b/support/build-api.sh @@ -1,3 +1,11 @@ +#!/usr/bin/env bash +set -eo pipefail + +cd "$(dirname "$0")" + +# Move to the root of the repository +cd ../ + # Delete old directory to ensure all files are updated rm -rf crates/bitwarden-api-api/src