commit caff0b3854bfcf7dcfb1712acbaca6a09a3e093f
parent 9a9acc9b135e610e169232487a89b9ff6d73d975
Author: Darren Clarke <darren@redaranj.com>
Date: Thu, 9 Nov 2023 09:08:30 +0100
Build script updates
Diffstat:
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -7,3 +7,4 @@ test_keys
cache/
bindings/
jniLibs/
+._*
diff --git a/mobile/android/.gitlab-ci.yml b/mobile/android/.gitlab-ci.yml
@@ -12,7 +12,7 @@ build_android:
- .macos_runners
stage: build
script:
- - /bin/bash ./mobile/android/build.sh
+ - ./mobile/android/build.sh
artifacts:
paths:
- ./mobile/android/out/
diff --git a/mobile/android/build.sh b/mobile/android/build.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
MOBILE_DIR="$(pwd)/mobile"
ANDROID_DIR="${MOBILE_DIR}/android"
diff --git a/mobile/apple/.gitlab-ci.yml b/mobile/apple/.gitlab-ci.yml
@@ -12,7 +12,7 @@ build_apple:
- .macos_runners
stage: build
script:
- - /bin/bash ./mobile/apple/build.sh
+ - ./mobile/apple/build.sh
artifacts:
paths:
- ./mobile/apple/out/
diff --git a/mobile/apple/build.sh b/mobile/apple/build.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
MOBILE_DIR="$(pwd)/mobile"
APPLE_DIR="${MOBILE_DIR}/apple"
@@ -19,18 +19,17 @@ rustup target add aarch64-apple-ios-sim
cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target-dir="${TARGET_DIR}"
# build the libraries
-cargo build --target aarch64-apple-darwin --release
-cargo build --target aarch64-apple-ios --release
-cargo build --target x86_64-apple-ios --release
-cargo build --target aarch64-apple-ios-sim --release
+cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-darwin --release --target-dir="${TARGET_DIR}"
+cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-ios --release --target-dir="${TARGET_DIR}"
+cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target x86_64-apple-ios --release --target-dir="${TARGET_DIR}"
+cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-ios-sim --release --target-dir="${TARGET_DIR}"
mkdir -p "${NEW_HEADER_DIR}"
cp "${HEADER_PATH}" "${NEW_HEADER_DIR}/"
cp "${BINDINGS_DIR}/${NAME}FFI.modulemap" "${NEW_HEADER_DIR}/module.modulemap"
+rm -rf "${OUT_DIR}
mkdir -p ${OUT_DIR}
-rm -rf "${OUT_DIR}/${NAME}_framework.xcframework"
-
xcrun lipo -create -output "${TARGET_DIR}/simulators.a" "${TARGET_DIR}/aarch64-apple-ios-sim/${BUILD_MODE}/${STATIC_LIB_NAME}" "${TARGET_DIR}/x86_64-apple-ios/${BUILD_MODE}/${STATIC_LIB_NAME}"
@@ -39,6 +38,6 @@ xcodebuild -create-xcframework \
-headers "${NEW_HEADER_DIR}" \
-library "${TARGET_DIR}/simulators.a" \
-headers "${NEW_HEADER_DIR}" \
- -output "${OUT_DIR}/${NAME}_framework.xcframework"
+ -output "${OUT_DIR}/${NAME}.xcframework"
cp "${BINDINGS_DIR}/${NAME}.swift" "${OUT_DIR}/"