android_tools_rs/aapt2/
mod.rs1mod compile;
11mod convert;
12mod daemon;
13mod diff;
14mod dump;
15mod link;
16mod optimize;
17mod version;
18
19pub use compile::*;
20pub use convert::*;
21pub use daemon::*;
22pub use diff::*;
23pub use dump::*;
24pub use link::*;
25pub use optimize::*;
26pub use version::*;
27
28use self::{daemon::Aapt2Daemon, diff::Aapt2Diff, version::Aapt2Version};
29use std::path::{Path, PathBuf};
30
31#[derive(Clone, Copy)]
32pub struct Aapt2;
33
34impl Aapt2 {
35 pub fn compile_incremental(self, res_path: &Path, compiled_res: &Path) -> Aapt2Compile {
37 Aapt2Compile::new(res_path, compiled_res)
38 }
39
40 pub fn compile_dir(self, res_dir: &Path, compiled_res: &Path) -> Aapt2Compile {
42 Aapt2Compile::new_from_res_dir(res_dir, compiled_res)
43 }
44
45 pub fn compile_zip(self, res_zip: &Path, compiled_res: &Path) -> Aapt2Compile {
47 Aapt2Compile::new_from_res_zip(res_zip, compiled_res)
48 }
49
50 pub fn link_inputs(self, inputs: &[PathBuf], output_apk: &Path, manifest: &Path) -> Aapt2Link {
52 Aapt2Link::new(inputs, output_apk, manifest)
53 }
54
55 pub fn link_compiled_res(
57 self,
58 compiled_res: Option<PathBuf>,
59 output_apk: &Path,
60 manifest: &Path,
61 ) -> Aapt2Link {
62 Aapt2Link::new_from_compiled_res(compiled_res, output_apk, manifest)
63 }
64
65 pub fn dump(self, subcommand: SubCommand, filename_apk: &Path) -> Aapt2Dump {
67 Aapt2Dump::new(subcommand, filename_apk)
68 }
69
70 pub fn diff(self, file: &[PathBuf]) -> Aapt2Diff {
73 Aapt2Diff::new(file)
74 }
75
76 pub fn optimize(self, output_apk: &Path, output_dir: &Path) -> Aapt2Optimize {
78 Aapt2Optimize::new(output_apk, output_dir)
79 }
80
81 pub fn convert(self, o: &Path) -> Aapt2Convert {
83 Aapt2Convert::new(o)
84 }
85
86 pub fn version(self, version: String) -> Aapt2Version {
88 Aapt2Version::new(version)
89 }
90
91 pub fn daemon(self, trace_folder: &Path) -> Aapt2Daemon {
94 Aapt2Daemon::new(trace_folder)
95 }
96}