I want to write a generic script for building some native libraries that are plugins for my mixed Java/Native product. These libraries use JNI and may have dependencies on other plugins (which will be PreBuilt dependencies)

I have my project building, finding dependencies and adding the appropriate header paths and linking to the libraries. It adds the JDK headers and libraries for JNI etc.

The problem is that every project produces a file called libmain.dylib or libmain.so. It makes sense to me that the source set is always called ‘main’ so it matches the sort of structure used for Java projects and every gradle file doesn’t need to be different in terms of declaring the source set and the dependencies for the source set, e.g. I will always have: