From 8fc051ba11085a5d6f0e07fe053b68ce991a5dc1 Mon Sep 17 00:00:00 2001 From: Lachezar Lechev Date: Fri, 25 Oct 2024 13:09:10 +0300 Subject: [PATCH] docs: Readme, release & config - explain NDK version and ranlib path setup Signed-off-by: Lachezar Lechev --- .cargo/config.toml | 5 +++++ .github/workflows/release.yml | 9 +++++++-- README.md | 19 +++++++++++++++---- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index fc748f1..711b788 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,10 @@ [env] +# Make sure to keep this version in line with the `.github/workflows/release.yml` +# action for releaseing stremio-core-kotlin! NDK_VERSION = "27.2.12479018" + +# Set the same RANLIB binary location for all the 4 targets: +# armv7-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android RANLIB_armv7_linux_androideabi = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" RANLIB_aarch64_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" RANLIB_i686_linux_android = "$$ANDROID_HOME/ndk/$$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4da84b5..9667bb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,11 @@ on: release: types: [published] +env: + # Make sure to keep this version in line with `.config/cargo.toml` file for + # stremio-core-kotlin! + NDK_VERSION: '27.2.12479018' + jobs: release: runs-on: ubuntu-latest @@ -24,8 +29,8 @@ jobs: # this version of the Java Runtime only recognizes class file versions up to 55.0 # uses: android-actions/setup-android@v3 uses: android-actions/setup-android@v2 - - name: Setup Android NDK - run: yes | sdkmanager "ndk;27.2.12479018" >/dev/null + - name: Setup Android NDK (${{ env.NDK_VERSION }}) + run: yes | sdkmanager "ndk;${{ env.NDK_VERSION }}" >/dev/null # use MSRV - name: Set Rust version to MSRV 1.70 diff --git a/README.md b/README.md index 259c794..40c8a2d 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,22 @@ [![](https://jitpack.io/v/Stremio/stremio-core-kotlin.svg)](https://jitpack.io/#Stremio/stremio-core-kotlin) -# Setup +## Setup -## Gradle +Prerequisite: +- Android NDK `27.2.12479018` + - The Linkers bin path needs to be added to your `$PATH` env. variable -### Add the JitPack repository to your root build.gradle + E.g.: `$ANDROID_HOME/ndk/$NDK_VERSION/toolchains/llvm/prebuilt/linux-x86_64/bin` (where ANDROID_HOME is installation folder for Android studio and NDK_VERSION is an env. variable set to `27.2.12479018`) + or `/path-to-extracted-archive/toolchains/llvm/prebuilt/linux-x86_64/bin` + - **Updating:** Needs to be updated in both `.cargo/config.toml` for the + `stremio-core-kotlin` build and the [`.github/workflows/release.yml`](.github/workflows/release.yml) + +## Using the kotlin library + +### Gradle + +#### Add the JitPack repository to your root build.gradle ```gradle allprojects { @@ -17,7 +28,7 @@ allprojects { } ``` -### Add the stremio-core-kotlin dependency +#### Add the stremio-core-kotlin dependency ```gradle dependencies {