flutter_rust_bridge
flutter_rust_bridge copied to clipboard
Ability to mark a method to be ignored by codegen
Is your feature request related to a problem? Please describe. I've got a JNI_OnLoad method that I have to export "C" in order for JNI to call it on init.
This method doesn't need to be exported to dart at all, but seems to be no matter what. I also need to build this library on iOS, which means I don't want the JNI picked up there (it'll generate into the iOS headers and definitely won't build there), but it doesn't look like codegen parses cfg(target) attributes I currently have guarding it.
Describe the solution you'd like
A way to mark a method to not be exported by codegen even if it is marked pub/extern.
Describe alternatives you've considered
Currently I'm just dividing my main input modules into ios/android and generating through those.
I agree. Feel free to make a PR!
@fzyzcjy Would you be ok with an addition to the codegen RawOpts to just ignore certain files, the paths of which would be passed in a vec? I feel like trying to parse out fn attributes might be a bit difficult.
LGTM :)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.