Instantly share code, notes, and snippets.

What would you like to do?
build.gradle with custom ndkBuild task
sourceSets.main {
jni.srcDirs = [] //disable automatic ndk-build call
jniLibs.srcDir 'src/main/jni'
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
commandLine "<path to your ndk>/ndk-build",
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment