How to add a dependsOn to a native build (c plugin)

Hi. We are building some c code, which relies on java jni headers, and also headers generated by a home grown java utility. I am trying to add these as dependencies to the native build.
I have tried various methods, starting with adding dependsOn to assemble task,.
However after looking deeper the c plugin generates tasks, presumably I would need the dependsOn adding to the generated compile task. How to do this I have not been able to discover.
Have seen various suggestions posted, but none now seem to work.
Help would be much appreciated, dont want to fallback to existing ant build :frowning:

Your best bet would be to use the Nokee JNI library plugin, see Building Java Native Interface (JNI) Projects

The plugin takes care of the wiring and we hope to soon add additional convenience around common JNI errors such as not properly exporting the methods in native code, etc.

If you are using an external build system for native (not Gradle), we are also working on build adapters to avoid migrating your build to Gradle if that is a constraint.

Without the Nokee plugins, you will need to query the JVM to access the JNI header location and add the required Javac flags to generate the native headers if you want to rely on those.

Thanks Daniel, however issue circumvented as build is for multi-platforms, and is split, picking up a jenkins stash of the dependencies prior to invoking gradle again, so in effect, dependency not required.

If you could point me to an example or the project is open source would be ideal for me to make any change in Nokee to better support your scenario if possible.