use super::aapt2_tool;
use crate::error::*;
use std::path::{Path, PathBuf};
pub struct Aapt2Daemon {
trace_folder: PathBuf,
help: bool,
}
impl Aapt2Daemon {
pub fn new(trace_folder: &Path) -> Self {
Self {
trace_folder: trace_folder.to_owned(),
help: false,
}
}
pub fn help(&mut self, help: bool) -> &mut Self {
self.help = help;
self
}
pub fn run(&self) -> Result<()> {
let mut aapt2 = aapt2_tool()?;
aapt2.arg("daemon");
aapt2.arg(&self.trace_folder);
if self.help {
aapt2.arg("-h");
}
aapt2.output_err(true)?;
Ok(())
}
}