-
Notifications
You must be signed in to change notification settings - Fork 111
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
MarijnS95
merged 1 commit into
master
from
move-default-intent-filters-out-of-serialization
Mar 16, 2022
Merged
ndk-build: Move default serialization of MAIN
intent filter to cargo-apk
#241
MarijnS95
merged 1 commit into
master
from
move-default-intent-filters-out-of-serialization
Mar 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MarijnS95
force-pushed
the
move-default-intent-filters-out-of-serialization
branch
from
March 16, 2022 16:08
9ab7ff3
to
2f26490
Compare
…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
force-pushed
the
move-default-intent-filters-out-of-serialization
branch
from
March 16, 2022 16:10
2f26490
to
316201c
Compare
dvc94ch
approved these changes
Mar 16, 2022
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asname
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 tocargo-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 setexported=true
by default then).