-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make android-activity dependency optional #2834
Conversation
How do you select which type of the activity you app uses after this merge? By explicitly adding android-activity to your app? |
I simply use |
Applications that are based on Winit should use the android-native-activity and android-game-activity features from Winit. These features will result in Winit adding the required dependency on android-activity and it will also mean that egui or your application crate doesn't need to specify any version for depending on android-activity. (Potentially leading to a conflict in the future if Winit bumps the version of android-activity that it uses) I think egui-winit should probably do the same as Winit here and provide android-native-activity and android-game-activity features that just map to the Winit features. This way egui-winit never directly depends on android-activity unless it needs to directly use the android-activity API in the future. CI can then hopefully just pick one of these features to use. |
|
Instead of depending on android-activity directly, this exposes the android-native-activity and android-game-activity features from Winit. This ensures that applications can choose what android-backend they use while also relying on Winit to decide what version of android-activity to use - without increasing the risk of a version conflict by having a direct dependency. _(NB: Egui doesn't currently use the android-activity API itself)_ Since android-activity provides the `android_main()` entry point for Android applications it's not possible to link in multiple version of the android-activity crate and so it's particularly important to avoid unnecessary direct dependencies that could cause a version conflict in the future. To help avoid the need for applications to directly depend on android-activity the Winit crate re-exports the android-activity API and exposes features to configure the backend so that application crates can instead rely on Winit to pull in a compatible version of android-activity. (This way version bumps for android-activity only need to be synchronized with the Winit crate). CI now enables the `android-native-activity` feature for testing. Fixes: emilk#2829 Fixes: emilk#2720 Closes: emilk#2834
Instead of depending on android-activity directly, this exposes the android-native-activity and android-game-activity features from Winit. This ensures that applications can choose what android-backend they use while also relying on Winit to decide what version of android-activity to use - without increasing the risk of a version conflict by having a direct dependency. _(NB: Egui doesn't currently use the android-activity API itself)_ Since android-activity provides the `android_main()` entry point for Android applications it's not possible to link in multiple version of the android-activity crate and so it's particularly important to avoid unnecessary direct dependencies that could cause a version conflict in the future. To help avoid the need for applications to directly depend on android-activity the Winit crate re-exports the android-activity API and exposes features to configure the backend so that application crates can instead rely on Winit to pull in a compatible version of android-activity. (This way version bumps for android-activity only need to be synchronized with the Winit crate). CI now enables the `android-native-activity` feature for testing. Fixes: emilk#2829 Fixes: emilk#2720 Closes: emilk#2834
I've opened up an alternative PR #2863 to hopefully address this issue by exposing features for the different backends (even though that may seem awkward; please see the PR for an explanation of why I think that's the appropriate solution here)
If possible, I would generally recommend aiming to avoid adding a direct dependency on Instead try to use the API re-exported from
By minimizing the number of crates that explicitly depend on the The problem with adding a direct dependency is that Winit is much more likely to be opinionated about what version of |
Better fix: #2863 |
Instead of depending on android-activity directly, this exposes the android-native-activity and android-game-activity features from Winit. This ensures that applications can choose what android-backend they use while also relying on Winit to decide what version of android-activity to use - without increasing the risk of a version conflict by having a direct dependency. _(NB: Egui doesn't currently use the android-activity API itself)_ Since android-activity provides the `android_main()` entry point for Android applications it's not possible to link in multiple version of the android-activity crate and so it's particularly important to avoid unnecessary direct dependencies that could cause a version conflict in the future. To help avoid the need for applications to directly depend on android-activity the Winit crate re-exports the android-activity API and exposes features to configure the backend so that application crates can instead rely on Winit to pull in a compatible version of android-activity. (This way version bumps for android-activity only need to be synchronized with the Winit crate). CI now enables the `android-native-activity` feature for testing. Fixes: #2829 Fixes: #2720 Closes: #2834
Instead of depending on android-activity directly, this exposes the android-native-activity and android-game-activity features from Winit. This ensures that applications can choose what android-backend they use while also relying on Winit to decide what version of android-activity to use - without increasing the risk of a version conflict by having a direct dependency. _(NB: Egui doesn't currently use the android-activity API itself)_ Since android-activity provides the `android_main()` entry point for Android applications it's not possible to link in multiple version of the android-activity crate and so it's particularly important to avoid unnecessary direct dependencies that could cause a version conflict in the future. To help avoid the need for applications to directly depend on android-activity the Winit crate re-exports the android-activity API and exposes features to configure the backend so that application crates can instead rely on Winit to pull in a compatible version of android-activity. (This way version bumps for android-activity only need to be synchronized with the Winit crate). CI now enables the `android-native-activity` feature for testing. Fixes: emilk#2829 Fixes: emilk#2720 Closes: emilk#2834
This allows Android-targeting builds to use not only native-activity, but game-activity and avoids using a specific version of android-activity because Egui doesn't directly use the android-activity API.