How to Include .so files as dependencies in a jar?


(kavin kankeshwar) #1

Is there a recommended way , Where a project depends on a native library (*.so). Ideally want the native *.so be included in a UberJar/Fatjar. So other java projects can include this jar as a dependency and still work, without having to install the native libraries on all machines. If there are any example or leads i can follow would be great!


(Peter Niederwieser) #2

As far as I know, there is no easy solution to packaging native code, as it must always be extracted into a directory before it is used. Some solutions such as One-JAR do this under the hood. I recommend to check out the gradle-one-jar plugin.


(kavin kankeshwar) #3

Thanks Peter, Also what about doing JNI, java header tasks, for c++ packages ? Is there a plugin or feature i could use ?


(Peter Niederwieser) #4

Please create a new topic and explain your requirements in detail.


(kavin kankeshwar) #5

Thanks Peter: created one http://forums.gradle.org/gradle/topics/how_to_create_a_jni_task_in_gradle?rfm=1