use crate::core::config::ResolvedCrateConfig;
pub fn emit(_config: &ResolvedCrateConfig) -> String {
r#"<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by alef. Do not edit by hand. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
</manifest>
"#
.to_string()
}
#[cfg(test)]
mod tests {
use super::*;
use crate::core::config::new_config::NewAlefConfig;
fn test_config() -> ResolvedCrateConfig {
let toml_str = r#"
[workspace]
languages = ["kotlin_android"]
[[crates]]
name = "test-lib"
sources = ["src/lib.rs"]
[crates.kotlin_android]
package = "dev.example"
[crates.jni]
"#;
let cfg: NewAlefConfig = toml::from_str(toml_str).unwrap();
cfg.resolve().unwrap().into_iter().next().unwrap()
}
#[test]
fn manifest_carries_no_package_attribute() {
let manifest = emit(&test_config());
assert!(
!manifest.contains("package="),
"manifest must not set the namespace via the deprecated package attribute: {manifest}"
);
assert_eq!(
manifest,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\
<!-- Generated by alef. Do not edit by hand. -->\n\
<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\
</manifest>\n",
"manifest content must be exactly the namespace-less shell"
);
}
}