Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
loopedresolve authored Aug 1, 2024
1 parent da85296 commit 4a7716d
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,48 @@ android {

## Building locally

There is a build_smoldotkotlin.sh script in the repo which can be used to build the Android Library archive.
The Android Native Development Kit (NDK) requires access to Android specific framework dependencies.
Although a Dockerfile is provided to build the AAR from the command line, Android Studio is recommended for local development and testing.

The following Android Studio Configuration was used to build locally:

```
Android Studio Koala | 2024.1.1 Patch 1
Build #AI-241.18034.62.2411.12071903, built on July 10, 2024
Runtime version: 17.0.11+0-17.0.11b1207.24-11852314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.3.1
```

**Android Studio > Tools > SDK Manager > SDK Tools:**
* SDK Tools v34.0.0
* NDK (Side by side) v26.1.10909125
* CMake v3.22.1

### Shell Script
The NDK code is built using CMake and called from Kotlin using the Java Native Interface (JNI). Static C++ library files for each Android Application Binary Interface (ABI) are required. The build_abilibs shell script will build the static library files required for each Android ABI.

```zsh
$ zsh build_smoldotkotlin.sh
$ zsh build_abilibs.sh
```
### Dockerfile

After building the Rust FFI libraries the script will build the `AAR` from a Docker container.
A Dockerfile is provided to build (but not test) the AAR for the project.

Note: the Dockerfile is configured to run on 64-bit architecture. If using x86 architecture, remove the `--platform` flag from the ubuntu build stage of the [Dockerfile](https://github.com/finsig/smoldot-kotlin/blob/bde451561f8c2003c184434406ebd2923fa6689f/Dockerfile#L39).

Build a Docker image from the Dockerfile:

```zsh
docker build -t "finsig:Dockerfile" .
```

Gradle Wrapper can then be invoked as follows:

```zsh
docker run --rm -v `pwd`:/project finsig:Dockerfile bash -c 'cd /project; \
./gradlew smoldotkotlin:bundleReleaseAar'
```

See [GitHub issues](https://github.com/finsig/smoldot-kotlin/issues) for notes regarding warning messages.

Expand Down

0 comments on commit 4a7716d

Please sign in to comment.