Skip to content

Commit

Permalink
build: Support building with custom ABIs from the command line
Browse files Browse the repository at this point in the history
Some configurations (particularly unity) require specific ABIs be
included or excluded. With this change, it can be done via

    ./gradlew ndk:assemble -PABI_FILTERS=armeabi-v7a,x86
  • Loading branch information
kattrali committed Feb 6, 2019
1 parent 73c72dc commit a68ca6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Expand Up @@ -87,8 +87,16 @@ You can build new `.aar` files as follows:
./gradlew clean :build
```

Files are generated into`build/outputs/aar`.
Files are generated into`[module]/build/outputs/aar`.

### Building with custom ABIs

To build the NDK module with specific ABIs, use the `ABI_FILTERS` project
option:

```shell
./gradlew clean :assemble -PABI_FILTERS=x86,arm64-v8a
```

## Running Tests

Expand Down
6 changes: 5 additions & 1 deletion ndk/build.gradle
Expand Up @@ -19,7 +19,11 @@ android {
minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK_VERSION)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'armeabi', 'x86', 'x86_64'
if (project.hasProperty("ABI_FILTERS")) {
abiFilters project.ABI_FILTERS.split(",")
} else {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'armeabi', 'x86', 'x86_64'
}
}
consumerProguardFiles 'proguard-rules.pro'
externalNativeBuild {
Expand Down

0 comments on commit a68ca6e

Please sign in to comment.