creator-tools 0.3.5

Mobile Game Framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::error::*;
use crate::types::*;
use std::fs::create_dir_all;
use std::{
    fs::File,
    io::Write,
    path::{Path, PathBuf},
};

pub fn gen_android_manifest(out_dir: &Path, manifest: &AndroidManifest) -> Result<PathBuf> {
    if !out_dir.exists() {
        create_dir_all(out_dir)?;
    }
    let manifest_path = out_dir.join("AndroidManifest.xml");
    let mut file = File::create(&manifest_path)?;
    writeln!(file, "{}", manifest.to_string())?;
    Ok(manifest_path)
}