Fix and update Bevy templates
This PR updates the Bevy templates to Bevy 0.16.
To test
cargo install --path .in this branchcargo mobile initchoose template 0 or 1cargo android runorcargo apple run
Draft because:
- [x] test on iOS (I do not have access to a mac / iOS device at the moment)
I can try to test it on macos/ios tomorrow or so. Feel free to ping me early/mid next week if I didn't get back to you by then :)
I can try to test it on macos/ios tomorrow or so. Feel free to ping me early/mid next week if I didn't get back to you by then :)
@FabianLars have you had time to look at this?
Just tested it. I never tested the old version so both things are probably unrelated to your PR but maybe still good to adress them.
- To adress https://github.com/tauri-apps/cargo-mobile2/issues/352 it seems like it helps to change cargo.toml from
[package.metadata.cargo-apple.ios]
frameworks = ["AudioToolbox"]
to
[package.metadata.cargo-apple.ios]
frameworks = ["AudioToolbox", "SystemConfiguration"]
- I added this https://github.com/tauri-apps/cargo-mobile2/blob/dev/templates/apps/egui/src/lib.rs#L142C1-L163 as well. Technically only the block with extern C is needed (if we change it to call main() ) but the catch_unwind stuff doesn't hurt i guess. Without this the linker fails to find the entry point.
Thank you!
I added this https://github.com/tauri-apps/cargo-mobile2/blob/dev/templates/apps/egui/src/lib.rs#L142C1-L163 as well. Technically only the block with extern C is needed (if we change it to call main() ) but the catch_unwind stuff doesn't hurt i guess. Without this the linker fails to find the entry point.
Usually the bevy_main macro takes care of providing an entry point, but this tool expects it to be called differently. Would it maybe make sense to make https://github.com/tauri-apps/cargo-mobile2/blob/8bc00deb687fcd7001f000d851906c8f693ef191/templates/platforms/xcode/Sources/%7B%7Bapp.name%7D%7D/bindings/bindings.h#L5 configurable?
Maybe but i'm in no position to judge that, i'm just doing the bare minimum here, like testing PRs 😅 Also, looking at bevy_main i'm not sure that'd actually help (didn't try it though)
Oh right, it was changed in 0.16. It would have only helped if we can rename the expected entry point in the bindings.
Thanks again for checking on iOS. This PR is ready for review then 🙂
Ah i forgot something. I need all commits to be signed before i can merge a PR.
If you could add a changefile like https://github.com/tauri-apps/cargo-mobile2/pull/453/files#diff-47e070136f64bf323a3f0cd2c156663dc4cc877bbf3ae4fd4a1d5ef410bd79eb (patch) that would be much appreciated as well :)
ahh the commits were still not signed. since i added new commits already i'll just bypass the rules this time.
thanks for the contribution
ahh the commits were still not signed. since i added new commits already i'll just bypass the rules this time.
Sorry, I misunderstood and only signed-off the commit with my git E-Mail. I should have followed your link :see_no_evil: