From 5612626944469623a8d21469357bf0ab69a6ca73 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Thu, 23 Nov 2023 08:18:05 +0100 Subject: [PATCH] Make Android docs build on docs.rs (#3236) --- Cargo.toml | 9 ++++++++- src/platform/android.rs | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 64c1f6e3b9..d20d049a22 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,14 @@ categories = ["gui"] rust-version = "1.65.0" [package.metadata.docs.rs] -features = ["rwh_04", "rwh_05", "rwh_06", "serde"] +features = [ + "rwh_04", + "rwh_05", + "rwh_06", + "serde", + # Enabled to get docs to compile + "android-native-activity", +] default-target = "x86_64-unknown-linux-gnu" # These are all tested in CI targets = [ diff --git a/src/platform/android.rs b/src/platform/android.rs index cb0528ef35..b5fde4ad49 100644 --- a/src/platform/android.rs +++ b/src/platform/android.rs @@ -84,5 +84,10 @@ impl EventLoopBuilderExtAndroid for EventLoopBuilder { /// use winit::platform::android::activity::AndroidApp; /// ``` pub mod activity { + // We enable the `"native-activity"` feature just so that we can build the + // docs, but it'll be very confusing for users to see the docs with that + // feature enabled, so we avoid inlining it so that they're forced to view + // it on the crate's own docs.rs page. + #[doc(no_inline)] pub use android_activity::*; }