Skip to content

Commit f3e5c13

Browse files
ribMarijnS95
authored andcommitted
Re-export 'ndk' and 'ndk_sys' crates
Since we expose `ndk` types in the public API it makes sense to re-export these APIs so users of android-activity can defer to these without needing to manually sync the versions for explicit dependencies.
1 parent fe171bc commit f3e5c13

File tree

2 files changed

+27
-19
lines changed

2 files changed

+27
-19
lines changed

android-activity/CHANGELOG.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
- The `ndk` and `ndk-sys` crates are now re-exported under `android_activity::ndk` and `android_activity::ndk_sys` ([#194](https://github.com/rust-mobile/android-activity/pull/194))
10+
911
## [0.6.0] - 2024-04-26
1012

1113
### Changed
@@ -25,32 +27,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2527
### Changed
2628
- Avoids depending on default features for `ndk` crate to avoid pulling in any `raw-window-handle` dependencies ([#142](https://github.com/rust-mobile/android-activity/pull/142))
2729

28-
**Note:** Technically, this could be observed as a breaking change in case you
29-
were depending on the `rwh_06` feature that was enabled by default in the
30-
`ndk` crate. This could be observed via the `NativeWindow` type (exposed via
31-
`AndroidApp::native_window()`) no longer implementing `rwh_06::HasWindowHandle`.
30+
**Note:** Technically, this could be observed as a breaking change in case you
31+
were depending on the `rwh_06` feature that was enabled by default in the
32+
`ndk` crate. This could be observed via the `NativeWindow` type (exposed via
33+
`AndroidApp::native_window()`) no longer implementing `rwh_06::HasWindowHandle`.
3234

33-
In the unlikely case that you were depending on the `ndk`'s `rwh_06` API
34-
being enabled by default via `android-activity`'s `ndk` dependency, your crate
35-
should explicitly enable the `rwh_06` feature for the `ndk` crate.
35+
In the unlikely case that you were depending on the `ndk`'s `rwh_06` API
36+
being enabled by default via `android-activity`'s `ndk` dependency, your crate
37+
should explicitly enable the `rwh_06` feature for the `ndk` crate.
3638

37-
As far as could be seen though, it's not expected that anything was
38-
depending on this (e.g. anything based on Winit enables the `ndk` feature
39-
based on an equivalent `winit` feature).
39+
As far as could be seen though, it's not expected that anything was
40+
depending on this (e.g. anything based on Winit enables the `ndk` feature
41+
based on an equivalent `winit` feature).
4042

41-
The benefit of the change is that it can help avoid a redundant
42-
`raw-window-handle 0.6` dependency in projects that still need to use older
43-
(non-default) `raw-window-handle` versions. (Though note that this may be
44-
awkward to achieve in practice since other crates that depend on the `ndk`
45-
are still likely to use default features and also pull in
46-
`raw-window-handles 0.6`)
43+
The benefit of the change is that it can help avoid a redundant
44+
`raw-window-handle 0.6` dependency in projects that still need to use older
45+
(non-default) `raw-window-handle` versions. (Though note that this may be
46+
awkward to achieve in practice since other crates that depend on the `ndk`
47+
are still likely to use default features and also pull in
48+
`raw-window-handles 0.6`)
4749

4850
- The IO thread now gets named `stdio-to-logcat` and main thread is named `android_main` ([#145](https://github.com/rust-mobile/android-activity/pull/145))
4951
- Improved IO error handling in `stdio-to-logcat` IO loop. ([#133](https://github.com/rust-mobile/android-activity/pull/133))
5052

5153
## [0.5.0] - 2023-10-16
5254
### Added
53-
- Added `MotionEvent::action_button()` exposing the button associated with button press/release actions ()
55+
- Added `MotionEvent::action_button()` exposing the button associated with button press/release actions ([#138](https://github.com/rust-mobile/android-activity/pull/138))
5456

5557
### Changed
5658
- rust-version bumped to 0.68 ([#123](https://github.com/rust-mobile/android-activity/pull/123))

android-activity/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,17 @@ use std::sync::Arc;
119119
use std::sync::RwLock;
120120
use std::time::Duration;
121121

122-
use input::KeyCharacterMap;
122+
use bitflags::bitflags;
123123
use libc::c_void;
124+
124125
use ndk::asset::AssetManager;
125126
use ndk::native_window::NativeWindow;
126127

127-
use bitflags::bitflags;
128+
// Since we expose `ndk` types in our public API it's convenient if crates can
129+
// defer to these re-exported APIs and avoid having to bump explicit
130+
// dependencies when they pull in new releases of android-activity.
131+
pub use ndk;
132+
pub use ndk_sys;
128133

129134
#[cfg(not(target_os = "android"))]
130135
compile_error!("android-activity only supports compiling for Android");
@@ -162,6 +167,7 @@ pub mod error;
162167
use error::Result;
163168

164169
pub mod input;
170+
use input::KeyCharacterMap;
165171

166172
mod config;
167173
pub use config::ConfigurationRef;

0 commit comments

Comments
 (0)