@ -90,50 +92,70 @@ This is managed by the Rust SDK.
### Rust SDK
### Rust SDK
The Rust SDK is hosted here : https://github.com/matrix-org/matrix-rust-sdk
The Rust SDK is hosted here: https://github.com/matrix-org/matrix-rust-sdk.
This repository contains an implementation of a Matrix client-server library in Rust.
With some bindings we can embed this sdk inside other environments, like Swift or Kotlin, with the help
This repository contains an implementation of a Matrix client-server library written in Rust.
of [Uniffi](https://github.com/mozilla/uniffi-rs)
With some bindings we can embed this sdk inside other environments, like Swift or Kotlin, with the help of [Uniffi](https://github.com/mozilla/uniffi-rs).
From these kotlin bindings we can generate native libs (.so files) and kotlin classes/interfaces.
From these kotlin bindings we can generate native libs (.so files) and kotlin classes/interfaces.
#### Matrix Rust Component Kotlin
To use these bindings in an android project, we need to wrap this up into an android library (as the form of an .aar file).
To use these bindings in an android project, we need to wrap this up into an android library (as the form of an .aar file).
This is the goal of https://github.com/matrix-org/matrix-rust-components-kotlin
This is the goal of https://github.com/matrix-org/matrix-rust-components-kotlin.
This repository is used for distributing kotlin releases of the Matrix Rust SDK.
This repository is used for distributing kotlin releases of the Matrix Rust SDK.
It'll provide the corresponding aar and also publish them on maven.
It'll provide the corresponding aar and also publish them on maven.
Most of the time you want to use the releases made on maven with gradle `implementation("org.matrix.rustcomponents:sdk-android:latest-version")`
Most of the time you want to use the releases made on maven with gradle:
- checkout both [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk) and [matrix-rust-components-kotlin](https://github.com/matrix-org/matrix-rust-components-kotlin) repositories
Then you can launch the build script with the following params:
Then you can launch the build script with the following params:
-p Local path to the rust-sdk repository
-`-p` Local path to the rust-sdk repository
-o Optional output path with the expected name of the aar file. By default the aar will be located in the corresponding build/outputs/aar directory.
- `-o` Optional output path with the expected name of the aar file. By default the aar will be located in the corresponding build/outputs/aar directory.
-r Flag to build in release mode
- `-r` Flag to build in release mode
-m Option to select the gradle module to build. Default is sdk.
- `-m` Option to select the gradle module to build. Default is sdk.
-t Option to to select an android target to build against. Default will build for all targets.
- `-t` Option to to select an android target to build against. Default will build for all targets.
So for example to build the sdk against aarch64-linux-android target and copy the generated aar to ElementX project:
So for example to build the sdk against aarch64-linux-android target and copy the generated aar to ElementX project: