Skip to content

Instantly share code, notes, and snippets.

@kyze8439690
Last active January 19, 2017 08:52
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyze8439690/7660297 to your computer and use it in GitHub Desktop.
Save kyze8439690/7660297 to your computer and use it in GitHub Desktop.
Use build.gradle to compile all jars in libs folder and ndk support
//compile all jar in libs folder
dependencies {
compile fileTree(dir: 'libs' , include: '*.jar')
}
//pack all so file into a jar and compile it
task nativeLibsToJar(
type: Zip,
description: 'create a jar archive of the native libs') {
destinationDir file('./libs')
baseName 'native-libs'
extension 'jar'
from 'libs'
include '**/*.so'
into 'lib'
}
tasks.withType(Compile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
clean.dependsOn 'cleanNativeLibsToJar'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment