Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sourceSets {
- main {
- jniLibs.srcDirs = ['libs']
- }
- }
- // called every time gradle gets executed, takes the native dependencies of
- // the natives configuration, and extracts them to the proper libs/ folders
- // so they get packed with the APK.
- task copyAndroidNatives() {
- file("libs/armeabi/").mkdirs()
- file("libs/armeabi-v7a/").mkdirs()
- file("libs/arm64-v8a/").mkdirs()
- file("libs/x86_64/").mkdirs()
- file("libs/x86/").mkdirs()
- configurations.natives.files.each { jar ->
- def outputDir = null
- if (jar.name.endsWith("natives-arm64-v8a.jar")) outputDir = file("libs/arm64-v8a")
- if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
- if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
- if (jar.name.endsWith("natives-x86_64.jar")) outputDir = file("libs/x86_64")
- if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
- if (outputDir != null) {
- copy {
- from zipTree(jar)
- into outputDir
- include "*.so"
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement