README.md
1# ndkports
2
3A collection of Android build scripts for various third-party libraries and the
4tooling to build them.
5
6If you're an Android app developer looking to *consume* these libraries, this is
7probably not what you want. This project builds AARs to be published to Maven.
8You most likely want to use the AAR, not build it yourself.
9
10Note: Gradle support for consuming these artifacts from an AAR is a work in
11progress.
12
13## Ports
14
15Each third-party project is called a "port". Ports consist of a description of
16where to fetch the source, apply any patches needed, build, install, and package
17the library into an AAR.
18
19A port is a subclass of the abstract Kotlin class `com.android.ndkports.Port`.
20Projects define the name and version of the port, the URL to fetch source from,
21a list of modules (libraries) to build, and the build steps.
22
23See the [Port class] for documentation on the port API.
24
25Individual port files are kept in `ports/$name/port.kts`. For example, the cURL
26port is [ports/curl/port.kts](ports/curl/port.kts).
27
28[Port class]: src/main/kotlin/com/android/ndkports/Port.kt
29
30## Building a Port
31
32We recommend using the supplied scripts and Dockerfile for consistent builds.
33
34To build a release for distribution to a Maven repo, `scripts/build_release.sh`
35
36To build a snapshot, `scripts/build_snapshot.sh`
37
38You can also pass custom gradle targets: `scripts/build_snapshot.sh curl`
39
40The scripts use the standard `ANDROID_NDK_ROOT` environment variable to
41locate the NDK. For example, `ANDROID_NDK_ROOT=/path/to/ndk scripts/build_release.sh`