Skip to content

Commit

Permalink
Make Android docs build on docs.rs (rust-windowing#3236)
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm authored and kchibisov committed Nov 24, 2023
1 parent a532e4b commit 0240166
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
5 changes: 5 additions & 0 deletions src/platform/android.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,10 @@ impl<T> EventLoopBuilderExtAndroid for EventLoopBuilder<T> {
/// 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::*;
}

0 comments on commit 0240166

Please sign in to comment.