Skip to content

Instantly share code, notes, and snippets.

@Tom-Ski
Created February 14, 2014 17:17
Show Gist options
  • Save Tom-Ski/9005072 to your computer and use it in GitHub Desktop.
Save Tom-Ski/9005072 to your computer and use it in GitHub Desktop.
Hoop Jumping
// 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();
configurations.natives.files.each { jar ->
def outputDir = null
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(outputDir != null) {
copy {
from zipTree(jar)
into outputDir
include "*.so"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment