jhugman / uniffi-bindgen-react-native

A uniffi bindings generator for calling Rust from react-native
https://jhugman.github.io/uniffi-bindgen-react-native/
Other
50 stars 5 forks source link

Build for selected Android targets #119

Closed jhugman closed 1 month ago

jhugman commented 1 month ago

Fixes #106

According to The Big O of Code Reviews, this is a O(n) change.

This issue is conceptually simple: we need to add one line to the build.gradle template.

Driving that line in the file is data about the targets being built.

targets comes from the ProjectConfig (a.k.a. ubrn.config.yaml), which makes this straightforward.

HOWEVER, --targets can be used when building!

SO, we can mutate the ProjectConfig while we're building.

BUT we don't want the second command overwriting the build.gradle so carefully specified in the first.

ubrn build android --and-generate --config ubrn.config.yaml --targets aarch64-linux-android,armv7-linux-androideabi

ubrn build ios --and-generate --config ubrn.config.yaml

THIS MEANT: adding platform specificity to the each of the generated files.

Drive-by Review also requested from @Johennes , if interested.

Johennes commented 1 month ago

Just to report back, I've tested this in https://github.com/unomed-dev/react-native-matrix-sdk and it appears to work great. 👍