diff --git a/docs/_developer_onboarding.md b/docs/_developer_onboarding.md index 7af9207365..a100a2beba 100644 --- a/docs/_developer_onboarding.md +++ b/docs/_developer_onboarding.md @@ -117,6 +117,10 @@ You can also have access to the aars through the [release](https://github.com/ma #### Build the SDK locally +Easiest way: run the script [./tools/sdk/build_rust_sdk.sh](./tools/sdk/build_rust_sdk.sh) and just answer the questions. + +Legacy way: + If you need to locally build the sdk-android you can use the [build](https://github.com/matrix-org/matrix-rust-components-kotlin/blob/main/scripts/build.sh) script. @@ -147,15 +151,6 @@ Troubleshooting: - If you get the error `thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', .cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-ndk-2.11.0/src/cli.rs:345:18` try updating your Cargo NDK version. In this case, 2.11.0 is too old so `cargo install cargo-ndk` to install a newer version. - If you get the error `Unsupported class file major version 64` try changing your JVM version. In this case, Java 20 is not supported in Gradle yet, so downgrade to an earlier version (Java 17 worked in this case). -Finally let the `matrix/impl` module use this aar by changing the dependencies from `libs.matrix.sdk` to `projects.libraries.rustsdk`: - -```groovy -dependencies { - api(projects.libraries.rustsdk) // <- use the local version of the sdk. Uncomment this line. - //implementation(libs.matrix.sdk) // <- use the released version. Comment this line. -} -``` - You are good to test your local rust development now! ### The Android project diff --git a/libraries/matrix/impl/build.gradle.kts b/libraries/matrix/impl/build.gradle.kts index a2b616f989..ff65a2768d 100644 --- a/libraries/matrix/impl/build.gradle.kts +++ b/libraries/matrix/impl/build.gradle.kts @@ -29,8 +29,12 @@ anvil { } dependencies { - // implementation(projects.libraries.rustsdk) - implementation(libs.matrix.sdk) + if (file("${rootDir.path}/libraries/rustsdk/matrix-rust-sdk.aar").exists()) { + println("\nNote: Using local binary of the Rust SDK.\n") + implementation(projects.libraries.rustsdk) + } else { + implementation(libs.matrix.sdk) + } implementation(projects.libraries.di) implementation(projects.libraries.androidutils) implementation(projects.libraries.network)