Last active
December 23, 2015 23:19
-
-
Save lyaotian/6708985 to your computer and use it in GitHub Desktop.
Package NDK so library by gradle.
https://groups.google.com/forum/#!msg/adt-dev/xj51eCWwhFw/w4tcy3n1s8kJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Compress the native libs located at libs/armeabi/ into archive file | |
| * libs/armeabi.jar | |
| * Destination directory inside the archive is lib/armeabi/<libs> | |
| * | |
| * Example of .jar needed structure : | |
| * |---lib/ | |
| * |---armeabi/ | |
| * |---libdatabase_sqlcipher.so | |
| * |---libsqlcipher_android.so | |
| * |---libstlport_shared.so | |
| * |---x86/ | |
| * |---libdatabase_sqlcipher.so | |
| * |---libsqlcipher_android.so | |
| * |---libstlport_shared.so | |
| * | |
| * reference : https://groups.google.com/forum/?fromgroups#!searchin/adt-dev/so/adt-dev/nQobKd2Gl_8/Z5yWAvCh4h4J | |
| */ | |
| task nativeLibsToJar( | |
| type: Zip, | |
| description: 'create a jar archive of the native libs') { | |
| destinationDir file('./libs') | |
| baseName 'native-libs' | |
| extension 'jar' | |
| from 'libs/armeabi' | |
| include '**/*.so' | |
| into 'lib/armeabi' | |
| } | |
| tasks.withType(Compile) { | |
| compileTask -> compileTask.dependsOn(nativeLibsToJar) | |
| } | |
| clean.dependsOn 'cleanNativeLibsToJar' | |
| You have to add the generated archive as a dependency : | |
| dependencies { | |
| compile files('libs/native-libs.jar') | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment