Fixed
Status Update
Comments
je...@google.com <je...@google.com>
je...@google.com <je...@google.com>
an...@google.com <an...@google.com> #2
Any plans to support this?
Description
I am attempting to get Robolectric unit tests for my Android Library that uses a JNI
.so
working. I can manually get the tests to run and use the.so
by building the JNI library for my native system and adding the path to the.so
toandroid.testOptions.unitTests.all{systemProperty("java.library.path"...)
Specifically I am trying to get the JNI building and hooked up properly for unit tests on my Android library and my test apps. My cross-compiling tasks that build the JNI libraries for Android are working properly when I add them to (Link to source) .
variant.jniLibs.addGeneratedSourceDirectory()
I tried to do something similar with my new tasks for natively building the JNI .so files using
variant.unitTest.jniLibs.addGeneratedSourceDirectory()
but I'm not seeing any effect and there's no task dependencies being triggered.Additional information: My JNI library is written in Rust and I was never able to get it to work well with existing AGP DSLs like
externalNativeBuild
orndk
(perhaps partially because I build it as part of an Android library and not an app? The full source that builds the JNI libraries is in the directory that I linked to above.