Publishing C++ static libraries

I’m investigating using gradle for our build process and I’m trying to see if there is an easy way to deploy C++ static libraries to nexus and add dependencies. We have one team that works on a set of static libraries and we want them to publish these libraries to nexus. Then other teams that depend on those static libraries would put a dependency in their build files and gradle would make the static libraries and headers available during build.

It looks like this works pretty easily as long as you’re doing shared libraries (.so files), but I don’t see an easy way to do this for static libraries (.a files). The cpp-lib plugin will publish a .so and .zip package to nexus, but I can’t find a way to get it to do the .a files. Am I missing something simple?

Nope you’re not missing something, Gradle is missing this support. The support for external dependencies in C++ has not kept pace with the rest of the C++ development effort. Once we have a fully-fledged variant model for C++, we plan to add support for publishing and resolving based on this model.

For now, you need to either: 1) stick with the original C++ support (no static libraries, no variant) or 2) work-around the limitations of publishing/resolution in your build.