Skip to content

Instantly share code, notes, and snippets.

@julianshen
Created June 15, 2013 15:40
Show Gist options
  • Save julianshen/5788510 to your computer and use it in GitHub Desktop.
Save julianshen/5788510 to your computer and use it in GitHub Desktop.
Include native lib in gradle
task copyNativeLibs(type: Copy) {
from fileTree(dir: 'jni', include: '**/*.so' ) into 'build/native-libs'
}
tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }
clean.dependsOn 'cleanCopyNativeLibs'
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
pkgTask.jniDir file('build/native-libs')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment