Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndk-build: Move default serialization of MAIN intent filter to cargo-apk #241

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

MarijnS95
Copy link
Member

The other two manual serialize_with functions have a very clear purpose of making the datastructure easier to work with, by turning a vector of strings into a more verbose XML element with the string as name field.

No such case with intent_filter, which needs no special serialization treatment but instead performs actual business logic to insert more elements based on what the caller wishes to serialize. This sort of logic is better moved to cargo-apk where a toml-parsed manifest is similarly enriched with sensible defaults to make Android development as accessible and out-of-the-box as possible.


As discussed in #204, this seems to be the most sensible place (or should we get something that mimicks serde(default) so that it's present earlier on? - might be more tricky to adequately set exported=true by default then).

@MarijnS95 MarijnS95 force-pushed the move-default-intent-filters-out-of-serialization branch from 9ab7ff3 to 2f26490 Compare March 16, 2022 16:08
…go-apk`

The other two manual `serialize_with` functions have a very clear
purpose of making the datastructure easier to work with, by turning a
vector of strings into a more verbose XML element with the string as
`name` field.

No such case with `intent_filter`, which needs no special serialization
treatment but instead performs actual business logic to insert more
elements based on what the caller wishes to serialize.  This
sort of logic is better moved to `cargo-apk` where a toml-parsed
manifest is similarly enriched with sensible defaults to make Android
development as accessible and out-of-the-box as possible.
@MarijnS95 MarijnS95 force-pushed the move-default-intent-filters-out-of-serialization branch from 2f26490 to 316201c Compare March 16, 2022 16:10
@MarijnS95 MarijnS95 merged commit a6f3e13 into master Mar 16, 2022
@MarijnS95 MarijnS95 deleted the move-default-intent-filters-out-of-serialization branch March 16, 2022 21:57
MarijnS95 added a commit that referenced this pull request Jun 21, 2022
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.
MarijnS95 added a commit that referenced this pull request Jul 4, 2022
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.
MarijnS95 added a commit that referenced this pull request Jul 5, 2022
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.
MarijnS95 added a commit that referenced this pull request Jul 5, 2022
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants