Skip to content

Commit

Permalink
docs: Readme, release & config - explain NDK version and ranlib path …
Browse files Browse the repository at this point in the history
…setup

Signed-off-by: Lachezar Lechev <[email protected]>
  • Loading branch information
elpiel committed Oct 25, 2024
1 parent 28d4888 commit 8fc051b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -17,7 +28,7 @@ allprojects {
}
```

### Add the stremio-core-kotlin dependency
#### Add the stremio-core-kotlin dependency

```gradle
dependencies {
Expand Down

0 comments on commit 8fc051b

Please sign in to comment.