Open Mygod opened 4 years ago
Can you elaborate here? We should be outputting lib$name.so
currently.
According to my test, it didn't work until we used some patch like https://github.com/shadowsocks/shadowsocks-android/commit/5ea3e3559adfb7b779ba6f3f633a02b3bcf50145.
Can you elaborate on "didn't work"? Sorry, just trying to understand what the issue is.
Yeah as said in title, the output binary is named $name
instead of lib$name.so
, so it does not get bundled into apk.
I understand that the code I changed in #31 is supposed to do exactly that but somehow that did not work.
Okay I guess the issue is that we are compiling a binary instead of libraries like most Android apps do. I wonder what's the easiest way to do this with this plugin then. Currently we are using a convoluted workaround: https://github.com/shadowsocks/shadowsocks-android/commit/833b35e7b792cf13709e4e5f1f87c591bffcf062
Should somebody see this, I think we can support this without a workaround right now using targetIncludes
. I'll leave this ticket to include a sample project that does exactly this.
I am not sure how this relates to compiling a binary?
I am not sure how this relates to compiling a binary?
If I understand correctly, the issue is that cargo build debug
will produce binary
, but the plugin won't package it into jniLibs
(which is where executables must go, last I checked). I think you can use targetIncludes
to package it, but I haven't verified. Hence, let's have a sample project/test showing how to do it and making sure we don't regress the functionality. Is that clear?
I think last time I checked, the binary is not extracted from apk if the filename does not match lib$name.so
. I could check again sometime.
OK, I took a look at this. The way I'd like to support binaries is as follows:
libname
optional and add binname
and/or binnames
.binnames
add --bin ...
to the command line as appropriatebinname.so
is enough here.)libs/$arch/...
location in the APK.
gradle.plugin.org.mozilla.rust-android-gradle:plugin:0.8.3
. Android gradle plugin 4.0.0-beta01.