Build fixes for Winit based examples

The latest branches for Winit (which update the Android backend to
use android-activity) now depend on the android-activity 0.2
release which broke the patching assumption for the Winit examples.
(they were patching based on the git url not crates.io)

It was also noticed that the latest android-activity-0.27 branch
isn't compatible with Egui currently because the (badly named) branch
is based on Winit master and there was recently a breaking API change
adding new window events which breaks Egui.

A note about the badly name branches has been added to the Cargo.toml
files for the Winit examples (they can't currently be fixes since
the -0.27 branch is part of a pull request).

For reference here:
- "android-activity" is based on Winit 0.27 (required for Egui compatibility)
- "android-activity-0.27" is based on Winit master

This patch adds Cargo.lock files for the Winit examples.

Fixes: #22
This commit is contained in:
Robert Bragg
2022-08-31 20:17:26 +01:00
parent f673662316
commit b7f01a43d9
12 changed files with 7490 additions and 53 deletions
-1
View File
@@ -19,4 +19,3 @@ local.properties
# Added by cargo
/target
Cargo.lock
+2413
View File
File diff suppressed because it is too large Load Diff
+28 -13
View File
@@ -15,9 +15,36 @@ egui = "0.19"
eframe = { version = "0.19", features = [ "wgpu" ] }
egui_demo_lib = "0.19"
[target.'cfg(not(target_os = "android"))'.dependencies]
env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.11.0"
android-activity = { version = "0.2", features = [ "game-activity" ] }
[patch.crates-io]
winit = { git = "https://github.com/rib/winit", branch = "android-activity-0.27" }
# This branch of Winit has an updated Android backend based on android-activity
# Note: The winit branches are current misnamed:
# - "android-activity" is based on Winit 0.27 (required for Egui compatibility)
# - "android-activity-0.27" is based on Winit master
# The -0.27 branch is currently associated with a pull request so we'll just
# stick with these names for now
winit = { git = "https://github.com/rib/winit", branch = "android-activity" }
#winit = { path = "../../../winit" }
# Note:
# Since android-activity is responsible for invoking the `android_main`
# entrypoint for a native Rust application there can only be a single
# implementation of the crate linked with the application.
#
# Since Winit also depends on android-activity (version = "0.2") but we'd like
# to build against the local version of android-activity in this repo then we
# use a [patch] to ensure we only end up with a single implementation.
android-activity = { path = "../../android-activity" }
# Egui 0.19 is missing some fixes for Android so we need to build against
# git master for now
egui = { git = "https://github.com/emilk/egui" }
eframe = { git = "https://github.com/emilk/egui" }
egui_demo_lib = { git = "https://github.com/emilk/egui" }
@@ -25,18 +52,6 @@ egui_demo_lib = { git = "https://github.com/emilk/egui" }
#eframe = { path = "../../../egui/crates/eframe" }
#egui_demo_lib = { path = "../../../egui/crates/egui_demo_lib" }
[target.'cfg(not(target_os = "android"))'.dependencies]
env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.11.0"
android-activity = { git = "https://github.com/rib/android-activity", features = [ "game-activity" ] }
# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path = "../../android-activity" }
[features]
default = []
desktop = []
-1
View File
@@ -19,4 +19,3 @@ local.properties
# Added by cargo
/target
Cargo.lock
+1893
View File
File diff suppressed because it is too large Load Diff
+21 -21
View File
@@ -16,33 +16,33 @@ egui-wgpu = { version = "0.19", features = [ "winit" ] }
egui-winit = { version = "0.19", default-features = false }
egui_demo_lib = "0.19"
[patch.crates-io]
winit = { git = "https://github.com/rib/winit", branch = "android-activity-0.27" }
#winit = { path="../../../winit" }
#egui = { git = "https://github.com/emilk/egui" }
#egui-wgpu = { git = "https://github.com/emilk/egui" }
#egui-winit = { git = "https://github.com/emilk/egui" }
#egui_extras = { git = "https://github.com/emilk/egui" }
#egui_demo_lib = { git = "https://github.com/emilk/egui" }
#egui = { path = "../../../egui/egui" }
#egui-wgpu = { path = "../../../egui/egui-wgpu" }
#egui-winit = { path = "../../../egui/egui-winit" }
#egui_extras = { path = "../../../egui/egui_extras" }
#egui_demo_lib = { path = "../../../egui/egui_demo_lib" }
[target.'cfg(not(target_os = "android"))'.dependencies]
env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "game-activity" ] }
android-activity = { version = "0.2", features = [ "game-activity" ] }
# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "game-activity" ] }
[patch.crates-io]
# This branch of Winit has an updated Android backend based on android-activity
# Note: The winit branches are current misnamed:
# - "android-activity" is based on Winit 0.27 (required for Egui compatibility)
# - "android-activity-0.27" is based on Winit master
# The -0.27 branch is currently associated with a pull request so we'll just
# stick with these names for now
winit = { git = "https://github.com/rib/winit", branch = "android-activity" }
#winit = { path = "../../../winit" }
# Note:
# Since android-activity is responsible for invoking the `android_main`
# entrypoint for a native Rust application there can only be a single
# implementation of the crate linked with the application.
#
# Since Winit also depends on android-activity (version = "0.2") but we'd like
# to build against the local version of android-activity in this repo then we
# use a [patch] to ensure we only end up with a single implementation.
android-activity = { path = "../../android-activity" }
[features]
default = []
-1
View File
@@ -19,4 +19,3 @@ local.properties
# Added by cargo
/target
Cargo.lock
+1545
View File
File diff suppressed because it is too large Load Diff
+22 -7
View File
@@ -7,8 +7,7 @@ edition = "2021"
[dependencies]
log = "0.4"
winit = { git = "https://github.com/rib/winit", branch = "android-activity-0.27"}
#winit = { path="../../../winit" }
winit = "0.27"
wgpu = "0.13.0"
pollster = "0.2"
@@ -17,12 +16,28 @@ env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "game-activity" ] }
android-activity = { version = "0.2", features = [ "game-activity" ] }
# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "game-activity" ] }
[patch.crates-io]
# This branch of Winit has an updated Android backend based on android-activity
# Note: The winit branches are current misnamed:
# - "android-activity" is based on Winit 0.27 (required for Egui compatibility)
# - "android-activity-0.27" is based on Winit master
# The -0.27 branch is currently associated with a pull request so we'll just
# stick with these names for now
winit = { git = "https://github.com/rib/winit", branch = "android-activity-0.27" }
#winit = { path = "../../../winit" }
# Note:
# Since android-activity is responsible for invoking the `android_main`
# entrypoint for a native Rust application there can only be a single
# implementation of the crate linked with the application.
#
# Since Winit also depends on android-activity (version = "0.2") but we'd like
# to build against the local version of android-activity in this repo then we
# use a [patch] to ensure we only end up with a single implementation.
android-activity = { path="../../android-activity" }
[features]
default = []
-1
View File
@@ -19,4 +19,3 @@ local.properties
# Added by cargo
/target
Cargo.lock
+1545
View File
File diff suppressed because it is too large Load Diff
+23 -8
View File
@@ -7,9 +7,8 @@ edition = "2021"
[dependencies]
log = "0.4"
winit = { git = "https://github.com/rib/winit", branch = "android-activity" }
#winit = { path="../../../winit" }
wgpu = "0.12.0"
winit = "0.27"
wgpu = "0.13"
pollster = "0.2"
[target.'cfg(not(target_os = "android"))'.dependencies]
@@ -17,12 +16,28 @@ env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.11.0"
android-activity = { path="../../android-activity", features = [ "native-activity" ] }
android-activity = { version = "0.2", features = [ "game-activity" ] }
# Since Winit also depends on android-activity (via a github url) we need to
# make sure we only resolve a single implementation.
[patch.'https://github.com/rib/android-activity']
android-activity = { path="../../android-activity", features = [ "native-activity" ] }
[patch.crates-io]
# This branch of Winit has an updated Android backend based on android-activity
# Note: The winit branches are current misnamed:
# - "android-activity" is based on Winit 0.27 (required for Egui compatibility)
# - "android-activity-0.27" is based on Winit master
# The -0.27 branch is currently associated with a pull request so we'll just
# stick with these names for now
winit = { git = "https://github.com/rib/winit", branch = "android-activity-0.27" }
#winit = { path = "../../../winit" }
# Note:
# Since android-activity is responsible for invoking the `android_main`
# entrypoint for a native Rust application there can only be a single
# implementation of the crate linked with the application.
#
# Since Winit also depends on android-activity (version = "0.2") but we'd like
# to build against the local version of android-activity in this repo then we
# use a [patch] to ensure we only end up with a single implementation.
android-activity = { path="../../android-activity" }
[features]
default = []