Swift package providing components from the matrix-rust-sdk
Go to file
ismailgulek 4c4216ba99
Create release script (#7)
2022-11-10 13:36:00 +03:00
.github/ISSUE_TEMPLATE Initial commit 2022-02-10 16:55:34 +02:00
.swiftpm/xcode/package.xcworkspace/xcshareddata Initial commit. 2022-02-10 17:28:10 +02:00
Sources/MatrixRustSDK Bump to v1.0.18-alpha (matrix-rust-sdk 078a75ea27262127891ea18192eb739d65f08e4b) 2022-11-10 11:02:11 +03:00
Tests/MatrixRustSDKTests Update to the latest Rust SDK (8a2d13feea627f7b1889071a129539e00ff7ccd3) 2022-06-29 20:26:05 +03:00
Tools/Scripts Create release script (#7) 2022-11-10 13:36:00 +03:00
.gitignore Create release script (#7) 2022-11-10 13:36:00 +03:00
LICENSE Closes #4 - Add license file 2022-04-26 10:25:52 +03:00
Package.swift Bump to v1.0.18-alpha (matrix-rust-sdk 078a75ea27262127891ea18192eb739d65f08e4b) 2022-11-10 11:02:11 +03:00
README.md Fix link for uniffi_bindgen and improve install instructions 2022-09-29 08:51:34 +03:00
SECURITY.md Initial commit 2022-02-10 16:55:34 +02:00

README.md

Swift package for Matrix Rust components

This repository is a Swift Package for distributing releases of the Matrix Rust SDK. It provides the Swift source code packaged in a format understood by the Swift package manager, and depends on a pre-compiled binary release of the underlying Rust code published from Matrix Rust SDK.

Releasing

Whenever a new release of the underlying components is available, we need to tag a new release in this repo to make them available to Swift components. To do so we need to:

  • running the .xcframework build script from matrix-rust-sdk/apple
  • copy the generated .swift files to this repository under Sources/MatrixRustComponentsSwift
  • update the tag version and checksum inside Package.swift
  • create a new tag and upload the zipped version of the .xcframework to it's artefacts section

Testing locally

The package can be added to an Xcode project from a local checkout and the binary target can be configured by toggling the useLocalBinary boolean. It might be necessary to manually add the resulting library to your project's General/Frameworks, Libraries, and Embedded Content for it to work.

Requirements

To build the package you will need the following installed:

  1. cargo + rustup https://www.rust-lang.org/tools/install
  2. uniffi-bindgen cargo install uniffi_bindgen --version x.x.x | --git https://github.com/mozilla/uniffi-rs --rev abc... where the version or revision needs to match the one defined in the rust-sdk-ffi crate Cargo.toml.
  3. nightly toolchain and simulator targets for your desired platform. See the release script for all possible options.
rustup toolchain install nightly
rustup default nightly
rustup target add aarch64-apple-ios --toolchain nightly
rustup target add aarch64-apple-darwin --toolchain nightly
rustup target add aarch64-apple-ios-sim --toolchain nightly
rustup target add x86_64-apple-ios --toolchain nightly
rustup target add x86_64-apple-darwin --toolchain nightly
  1. matrix-rust-sdk cloned next to this repo git clone https://github.com/matrix-org/matrix-rust-sdk
  2. When running the debug_build_xcframework.sh script, enable the useLocalBinary flag in Package.swift.