Skip to content

Instantly share code, notes, and snippets.

@ryardley
Created January 5, 2019 10:19
Show Gist options
  • Save ryardley/1596aad949a726f3d9660e84e57ebb40 to your computer and use it in GitHub Desktop.
Save ryardley/1596aad949a726f3d9660e84e57ebb40 to your computer and use it in GitHub Desktop.
Alter build.gradle
android {
// ...
defaultConfig {
// ...
// the following configures ndk-build to build a "helloworld" module
ndk {
abiFilters "armeabi-v7a", "x86"
moduleName "helloworld"
ldLibs "log"
}
}
// ...
// Here we can add source code to our project
sourceSets {
main {
// first our new Java code
java.srcDirs = ["../../djinni/java", "src/main/java"]
// second our JNI classes
jni.srcDirs = ["../../djinni/jni"]
}
}
externalNativeBuild {
// This points ndk-build at our Android.mk file
ndkBuild {
path file('src/main/jni/Android.mk')
}
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment