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

Supports resource attribute for MetaData #67

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cargo-apk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ uses_cleartext_traffic = true
# See https://developer.android.com/guide/topics/manifest/meta-data-element
#
# Note: there can be several .meta_data entries.
# Note: the `resource` attribute is currently not supported.
[[package.metadata.android.application.meta_data]]
name = "com.samsung.android.vr.application.mode"
value = "vr_only"
Expand Down Expand Up @@ -225,7 +224,6 @@ always_retain_task_state = true
# See https://developer.android.com/guide/topics/manifest/meta-data-element
#
# Note: there can be several .meta_data entries.
# Note: the `resource` attribute is currently not supported.
[[package.metadata.android.application.activity.meta_data]]
name = "com.oculus.vr.focusaware"
value = "true"
Expand Down
3 changes: 2 additions & 1 deletion cargo-apk/src/apk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ impl<'a> ApkBuilder<'a> {

manifest.application.activity.meta_data.push(MetaData {
name: "android.app.lib_name".to_string(),
value: artifact.name.replace('-', "_"),
value: Some(artifact.name.replace('-', "_")),
resource: None,
});

let crate_path = self.cmd.manifest().parent().expect("invalid manifest path");
Expand Down
4 changes: 3 additions & 1 deletion ndk-build/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ pub struct MetaData {
#[serde(rename(serialize = "android:name"))]
pub name: String,
#[serde(rename(serialize = "android:value"))]
pub value: String,
pub value: Option<String>,
#[serde(rename(serialize = "android:resource"))]
pub resource: Option<String>,
}

/// Android [uses-feature element](https://developer.android.com/guide/topics/manifest/uses-feature-element).
Expand Down
Loading