• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
32ndkports requires an NDK to be used for building to be specified on the command
33line as well as a list of packages to build. For example, to build cURL:
34
35```bash
36$ ./gradlew run --args='--ndk /path/to/android-ndk-r20 openssl curl'
37Build output...
38$ find  -name '*.aar'
39./out/curl/curl.aar
40./out/openssl/openssl.aar
41```
42
43Note that dependencies currently need to be already built or ordered explicitly.
44
45To build all ports using Docker, use `scripts/build.sh`.
46