Skip to content

Commit dc38fcb

Browse files
authored
ndk-build,cargo-apk: Rename intent_filters back to intent_filter (#305)
We commonly name vectors of items with their singular form so that they read nicer in TOML and XML (i.e. `[[intent_filter]]` adds a single entry to that list, and gets serialized as a single `<intent-filter>` XML element) and this matches Android's `intent-filter` naming too. This change in a6f3e13 ("ndk-build: Move default serialization of `MAIN` intent filter to `cargo-apk` (#241)") was made purely with `Vec` in mind, but breaks existing manifest parsing nor was anticipated to be a breaking change in this area as the README still carries `intent_filter` instead of `intent_filters` in its `Cargo.toml` metadata reference.
1 parent caeb591 commit dc38fcb

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

cargo-apk/CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Unreleased
22

3+
# 0.9.3 (2022-07-05)
4+
35
- Allow configuration of alternate debug keystore location; require keystore location for release builds. ([#299](https://github.com/rust-windowing/android-ndk-rs/pull/299))
6+
- **Breaking:** Rename `Activity::intent_filters` back to `Activity::intent_filter`. ([#305](https://github.com/rust-windowing/android-ndk-rs/pull/305))
47

58
# 0.9.2 (2022-06-11)
69

cargo-apk/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cargo-apk"
3-
version = "0.9.2"
3+
version = "0.9.3"
44
authors = ["The Rust Windowing contributors"]
55
edition = "2018"
66
description = "Helps cargo build APKs"
@@ -16,7 +16,7 @@ cargo-subcommand = "0.7"
1616
dunce = "1"
1717
env_logger = "0.9"
1818
log = "0.4"
19-
ndk-build = { path = "../ndk-build", version = "0.6.0" }
19+
ndk-build = { path = "../ndk-build", version = "0.7.0" }
2020
serde = "1"
2121
thiserror = "1.0.31"
2222
toml = "0.5"

cargo-apk/src/apk.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ impl<'a> ApkBuilder<'a> {
6969

7070
// Add a default `MAIN` action to launch the activity, if the user didn't supply it by hand.
7171
if activity
72-
.intent_filters
72+
.intent_filter
7373
.iter()
7474
.all(|i| i.actions.iter().all(|f| f != "android.intent.action.MAIN"))
7575
{
76-
activity.intent_filters.push(IntentFilter {
76+
activity.intent_filter.push(IntentFilter {
7777
actions: vec!["android.intent.action.MAIN".to_string()],
7878
categories: vec!["android.intent.category.LAUNCHER".to_string()],
7979
data: vec![],

ndk-build/CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Unreleased
22

3-
- Allow NDK r23 `-lgcc` workaround to work for target directories containing spaces. ([#298](https://github.com/rust-windowing/android-ndk-rs/pull/298))
3+
# 0.7.0 (2022-07-05)
4+
5+
- Fix NDK r23 `-lgcc` workaround for target directories containing spaces. ([#298](https://github.com/rust-windowing/android-ndk-rs/pull/298))
46
- Invoke `clang` directly instead of through the NDK's wrapper scripts. ([#306](https://github.com/rust-windowing/android-ndk-rs/pull/306))
7+
- **Breaking:** Rename `Activity::intent_filters` back to `Activity::intent_filter`. ([#305](https://github.com/rust-windowing/android-ndk-rs/pull/305))
58

69
# 0.6.0 (2022-06-11)
710

ndk-build/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ndk-build"
3-
version = "0.6.0"
3+
version = "0.7.0"
44
authors = ["The Rust Windowing contributors"]
55
edition = "2018"
66
description = "Utilities for building Android binaries"

ndk-build/src/manifest.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ pub struct Activity {
106106
#[serde(rename(serialize = "meta-data"))]
107107
#[serde(default)]
108108
pub meta_data: Vec<MetaData>,
109-
/// If no `MAIN` action exists in any intent filter, a default `MAIN` filter is serialized.
109+
/// If no `MAIN` action exists in any intent filter, a default `MAIN` filter is serialized by `cargo-apk`.
110110
#[serde(rename(serialize = "intent-filter"))]
111111
#[serde(default)]
112-
pub intent_filters: Vec<IntentFilter>,
112+
pub intent_filter: Vec<IntentFilter>,
113113
}
114114

115115
impl Default for Activity {
@@ -122,7 +122,7 @@ impl Default for Activity {
122122
orientation: None,
123123
exported: None,
124124
meta_data: Default::default(),
125-
intent_filters: Default::default(),
125+
intent_filter: Default::default(),
126126
}
127127
}
128128
}

0 commit comments

Comments
 (0)