Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple rust libraries in core build.gradle #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nain-F49FF806
Copy link

This will generate bindings for all libraries mentioned in cargo.ndk plugin config.

Also, a small addition of generated Kotlin files to kotlin srcdir

Also, a small addition of generated Kotlin files to kotlin srcdir
@ianthetechie ianthetechie self-requested a review April 9, 2024 05:19
@ianthetechie
Copy link
Owner

Sorry I haven't got back to this in some time! Out of curiosity, is your approach still working with the latest cargo-ndk release? I hit an issue the other day (just fixed in the template) which seems closely related and I'm not sure the latest release supports multiple library linkage.

See bbqsrc/cargo-ndk#137 for discussion.

@nain-F49FF806
Copy link
Author

nain-F49FF806 commented Jun 3, 2024

We hit a similar issue during building for f-droid [link]. For now, pinning the cargo-ndk version worked as a workaround.

I didn't look closer at the time, but now that you mention it, I think this is indeed the same issue we faced.

@ianthetechie
Copy link
Owner

Yup, it's the exact same issue. You can see how I ended up fixing it by specifying the package name.

Since this restricts to a single package, I'm not sure the use case of multiple libraries is supported incargo-ndk currently. If that's correct, you might want to weigh in on the issue. (I'm also curious why you're using multiple libraries; I would only expect most apps to need one; I guess just organizational ease?).

@nain-F49FF806
Copy link
Author

I do intend to use multiple rust libraries in future apps for independent/orthogonal functionality.
(Even in the current app, at a later point, perhaps. Currently, I am not actively using multiple libraries, other than the foobar one :).

To reduce boilerplate, I thought of doing it like this PR. By having them built together.
But perhaps, considering this is no more supported, having Gradle modules for each rust library may be another viable option ?

@ianthetechie
Copy link
Owner

Sorry I kinda left this PR hanging for a while ;) In my opinion, separate Gradle modules is probably the best idea. That makes logical sense to me, and works best with the way cargo ndk is currently set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants