I try to generate headers file with javah
. I have some issues but my main concern is that I can't generate the classpath argument of the command line : This argument should contain the classpath of my current android project (android.jar
, my project and its dependencies).
commandLine org.gradle.internal.jvm.Jvm.current().getExecutable('javah'),
"-d", 'src/main/jni',
"-classpath", classpath, "my.project.MainActivity"
actually, the classpath (variable classpath
) is generated by hand. I would like to generate it using gradle dependencies instead, as gradle depency cache path are complicated to use (hard to compute by hand, ...)
It try to use sourceSets.main.runtimeClasspath
and/or sourceSets.main.compileClasspath
def classpath = sourceSets.main.compileClasspath
but each time, gradle throw an error :
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find property 'compileClasspath' on source set main.
How can I generate my classpath variable using the classpath of my current gradle project ?