From 4818de6709fb4035e213a9474c30d8fc1e8360b7 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 12 Aug 2022 01:42:39 +0100 Subject: [PATCH] examples: force Winit to use in-tree android-activity This fixes build errors about not specifying either of the "native-activity" or "game-activity" features. The issue came about because the in-tree examples want to build against the in-tree version of android-activity located with a relative `path = ` but these particular examples depend on Winit which would resolve a second implementation of android-activity, via a github url - where Cargo will treat them as completely different crates. --- examples/agdk-egui/Cargo.toml | 5 +++++ examples/agdk-winit-wgpu/Cargo.toml | 5 +++++ examples/na-winit-wgpu/Cargo.toml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/examples/agdk-egui/Cargo.toml b/examples/agdk-egui/Cargo.toml index 4a3c8fc..31ebc15 100644 --- a/examples/agdk-egui/Cargo.toml +++ b/examples/agdk-egui/Cargo.toml @@ -45,6 +45,11 @@ env_logger = "0.9" android_logger = "0.11.0" android-activity = { path="../../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 = [ "game-activity" ] } + [features] default = [] desktop = [] diff --git a/examples/agdk-winit-wgpu/Cargo.toml b/examples/agdk-winit-wgpu/Cargo.toml index 28427d2..7204c54 100644 --- a/examples/agdk-winit-wgpu/Cargo.toml +++ b/examples/agdk-winit-wgpu/Cargo.toml @@ -19,6 +19,11 @@ env_logger = "0.9" android_logger = "0.11.0" android-activity = { path="../../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 = [ "game-activity" ] } + [features] default = [] desktop = [] diff --git a/examples/na-winit-wgpu/Cargo.toml b/examples/na-winit-wgpu/Cargo.toml index 00e9107..3915abd 100644 --- a/examples/na-winit-wgpu/Cargo.toml +++ b/examples/na-winit-wgpu/Cargo.toml @@ -19,6 +19,11 @@ env_logger = "0.9" android_logger = "0.11.0" android-activity = { path="../../android-activity", features = [ "native-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" ] } + [features] default = [] desktop = []