I want to built a binary project and add a prebuilt library. This prebuilt library (i.e. Embedded v8 JavaScript Engine) does not only contain of a single .so file, but multiple .a files. I couldn’t figure out how to add it as a library. I ended up with something like:
model {
repositories {
libs(PrebuiltLibraries) {
v8 {
headers.srcDir "libs/v8/"
fileTree(
dir: "libs/v8/out/x64.release/obj.target/",
include: ["tools/gyp/*.a", "third_party/icu/libicu*.a"],
exclude: ["tools/gyp/libv8_nosnapshot.a"]
).visit { details ->
if(!details.isDirectory()) {
binaries.withType(StaticLibraryBinary) {
staticLibraryFile = details.file
}
}
}
}
}
}
}
But this way, only the latest *.a file will be linked with the compiled result.
Is this in general the right way to define prebuilt dependencies (somehow looks like I did it a bit too cumbersome)? How can I add a library, that has multiple binary files the right way?