There is a java library which depends on some c++ libraries using JNI, So when compiling the c++ libraries header files need to be created using javah
In ant we can do the following and it works. Wanted to find a “gradle’ish” way to do the same.
<target name="jni" depends="compile">
<javah
classpath="${build}"
outputfile="../src/jni/jni_headers.h"
class="com.a.b.c.Class"/>
</target>
found something similar here: https://github.com/rklaren/GradleJNI/blob/master/build.gradle#L42-L55 but it says “hack” and is couple of years old so, want to check if there is a cleaner way to do it.