Merge pull request #4021 from element-hq/rav/build_sdk_for_local_machine
Build SDK for the local hardware
This commit is contained in:
commit
8cca6f7997
2 changed files with 11 additions and 4 deletions
|
|
@ -130,9 +130,9 @@ Prerequisites:
|
||||||
```
|
```
|
||||||
cargo install cargo-ndk
|
cargo install cargo-ndk
|
||||||
```
|
```
|
||||||
* Install the Android Rust toolchain:
|
* Install the Android Rust toolchain for your machine's hardware:
|
||||||
```
|
```
|
||||||
rustup target add aarch64-linux-android
|
rustup target add aarch64-linux-android x86_64-linux-android
|
||||||
```
|
```
|
||||||
* Depending on the location of the Android SDK, you may need to set
|
* Depending on the location of the Android SDK, you may need to set
|
||||||
`ANDROID_HOME`:
|
`ANDROID_HOME`:
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,13 @@ buildApp=${buildApp:-no}
|
||||||
|
|
||||||
cd "${elementPwd}"
|
cd "${elementPwd}"
|
||||||
|
|
||||||
|
default_arch="$(uname -m)-linux-android"
|
||||||
|
# On ARM MacOS, `uname -m` returns arm64, but the toolchain is called aarch64
|
||||||
|
default_arch="${default_arch/arm64/aarch64}"
|
||||||
|
|
||||||
|
read -p "Enter the architecture you want to build for (default '$default_arch'): " target_arch
|
||||||
|
target_arch="${target_arch:-${default_arch}}"
|
||||||
|
|
||||||
# If folder ../matrix-rust-components-kotlin does not exist, clone the repo
|
# If folder ../matrix-rust-components-kotlin does not exist, clone the repo
|
||||||
if [ ! -d "../matrix-rust-components-kotlin" ]; then
|
if [ ! -d "../matrix-rust-components-kotlin" ]; then
|
||||||
printf "\nFolder ../matrix-rust-components-kotlin does not exist. Cloning the repository into ../matrix-rust-components-kotlin.\n\n"
|
printf "\nFolder ../matrix-rust-components-kotlin does not exist. Cloning the repository into ../matrix-rust-components-kotlin.\n\n"
|
||||||
|
|
@ -71,8 +78,8 @@ git reset --hard
|
||||||
git checkout main
|
git checkout main
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
printf "\nBuilding the SDK for aarch64-linux-android...\n\n"
|
printf "\nBuilding the SDK for ${target_arch}...\n\n"
|
||||||
./scripts/build.sh -p "${rustSdkPath}" -m sdk -t aarch64-linux-android -o "${elementPwd}/libraries/rustsdk"
|
./scripts/build.sh -p "${rustSdkPath}" -m sdk -t "${target_arch}" -o "${elementPwd}/libraries/rustsdk"
|
||||||
|
|
||||||
cd "${elementPwd}"
|
cd "${elementPwd}"
|
||||||
mv ./libraries/rustsdk/sdk-android-debug.aar ./libraries/rustsdk/matrix-rust-sdk.aar
|
mv ./libraries/rustsdk/sdk-android-debug.aar ./libraries/rustsdk/matrix-rust-sdk.aar
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue