> I am sort of surprised that there isn't a widely used tool that uses codegen to generate jni bindings sort of like what the jna does but at build time
There are several, including SWIG.
There are several, including SWIG.
All the good bindings I use are generated by custom systems (ie, usually some Python scripts) tailored for the specific way their library works.