mozilla / rust-android-gradle

Apache License 2.0
1.03k stars 67 forks source link

Can I use this also as an non-android jni library? #23

Closed deeprobin closed 4 years ago

deeprobin commented 4 years ago

If yes, how? If no, how?

ncalexan commented 4 years ago

If yes, how? If no, how?

Hi @deeprobin: sorry for the very delayed reply. Pretty much all of the functionality here assumes that the Rust being built is compiled using an Android NDK -- i.e., most of the subtle bits are around configuring CC/CXX/AR etc for the prebuilt NDK clang toolchain. Most of the remaining functionality has to do with wiring tasks into the com.android.* Gradle plugin. My guess is that with effort you could extract the Cargo-specific pieces, but at that point you probably just want to start a new plugin. (And such a plugin might exist already.)

So I'm going to say no, it's not possible, and in fact it's probably an anti-goal of this plugin to support non-Android usages. That said, the basic method will apply and you could either learn or copy code and layout from this example.