diff --git a/apple/MatrixRustSDK/build_xcframework.sh b/apple/build_xcframework.sh similarity index 91% rename from apple/MatrixRustSDK/build_xcframework.sh rename to apple/build_xcframework.sh index dbf73e72e..c031934d2 100755 --- a/apple/MatrixRustSDK/build_xcframework.sh +++ b/apple/build_xcframework.sh @@ -4,7 +4,7 @@ set -eEu cd "$(dirname "$0")" # Path to the repo root -SRC_ROOT=../.. +SRC_ROOT=.. TARGET_DIR="${SRC_ROOT}/target" @@ -87,8 +87,3 @@ if [ -f "${GENERATED_DIR}/libmatrix_sdk_ffi_macos.a" ]; then rm -rf "${GENERATED if [ -f "${GENERATED_DIR}/libmatrix_sdk_ffi_iossimulator.a" ]; then rm -rf "${GENERATED_DIR}/libmatrix_sdk_ffi_iossimulator.a"; fi if [ -f "${GENERATED_DIR}/libmatrix_sdk_ffi_maccatalyst.a" ]; then rm -rf "${GENERATED_DIR}/libmatrix_sdk_ffi_maccatalyst.a"; fi if [ -d ${HEADERS_DIR} ]; then rm -rf ${HEADERS_DIR}; fi - -# Debug -> Copy generated files over to ../../../matrix-rust-components-swift -# rsync -a --delete "${GENERATED_DIR}/MatrixSDKFFI.xcframework" "../../../matrix-rust-components-swift/" -# rsync -a --delete "${GENERATED_DIR}/swift/" "../../../matrix-rust-components-swift/Sources/MatrixRustSDK" - diff --git a/apple/MatrixRustSDK/debug_build_xcframework.sh b/apple/debug_build_xcframework.sh similarity index 70% rename from apple/MatrixRustSDK/debug_build_xcframework.sh rename to apple/debug_build_xcframework.sh index 0f579c98c..86bc31aec 100755 --- a/apple/MatrixRustSDK/debug_build_xcframework.sh +++ b/apple/debug_build_xcframework.sh @@ -1,10 +1,17 @@ #!/usr/bin/env bash set -eEu -cd "$(dirname "$0")" +IS_CI=false + +if [ $# -eq 1 ]; then + IS_CI=true + echo "Running CI build" +else + echo "Running debug build" +fi # Path to the repo root -SRC_ROOT=../.. +SRC_ROOT=.. TARGET_DIR="${SRC_ROOT}/target" @@ -51,8 +58,12 @@ xcodebuild -create-xcframework \ if [ -f "${GENERATED_DIR}/libmatrix_sdk_ffi_iossimulator.a" ]; then rm -rf "${GENERATED_DIR}/libmatrix_sdk_ffi_iossimulator.a"; fi if [ -d ${HEADERS_DIR} ]; then rm -rf ${HEADERS_DIR}; fi -# Debug -> Copy generated files over to ../../../matrix-rust-components-swift -echo "$(echo "import MatrixSDKFFIWrapper\n"; cat "${SWIFT_DIR}/sdk.swift")" > "${SWIFT_DIR}/sdk.swift" +if [ "$IS_CI" = false ] ; then + echo "Preparing matrix-rust-components-swift" -rsync -a --delete "${GENERATED_DIR}/MatrixSDKFFI.xcframework" "../../../matrix-rust-components-swift/" -rsync -a --delete "${GENERATED_DIR}/swift/" "../../../matrix-rust-components-swift/Sources/MatrixRustSDK" + # Debug -> Copy generated files over to ../../../matrix-rust-components-swift + echo "$(echo "import MatrixSDKFFIWrapper\n"; cat "${SWIFT_DIR}/sdk.swift")" > "${SWIFT_DIR}/sdk.swift" + + rsync -a --delete "${GENERATED_DIR}/MatrixSDKFFI.xcframework" "${SRC_ROOT}/../matrix-rust-components-swift/" + rsync -a --delete "${GENERATED_DIR}/swift/" "${SRC_ROOT}/../matrix-rust-components-swift/Sources/MatrixRustSDK" +fi