Struct crossbundle_tools::types::Aapt2Optimize
source · [−]pub struct Aapt2Optimize { /* private fields */ }
Expand description
Preforms resource optimizations on an APK
Implementations
sourceimpl Aapt2Optimize
impl Aapt2Optimize
sourcepub fn new(output_apk: &Path, output_dir: &Path) -> Aapt2Optimize
pub fn new(output_apk: &Path, output_dir: &Path) -> Aapt2Optimize
Initialize aapt2 optimize then specifies path to the aapt2 link output APK and Path to the output directory (for splits)
sourcepub fn config_xml_file(&mut self, config_xml_file: &Path) -> &mut Aapt2Optimize
pub fn config_xml_file(&mut self, config_xml_file: &Path) -> &mut Aapt2Optimize
Specifies path to XML configuration file
sourcepub fn apk_artifacts(&mut self, apk_artifacts: bool) -> &mut Aapt2Optimize
pub fn apk_artifacts(&mut self, apk_artifacts: bool) -> &mut Aapt2Optimize
Print the multi APK artifacts and exit
sourcepub fn target_densities(&mut self, target_densities: &str) -> &mut Aapt2Optimize
pub fn target_densities(&mut self, target_densities: &str) -> &mut Aapt2Optimize
Comma separated list of the screen densities that the APK will be optimized for. All the resources that would be unused on devices of the given densities will be removed from the APK
sourcepub fn resources_config_path(
&mut self,
resources_config_path: &Path
) -> &mut Aapt2Optimize
pub fn resources_config_path(
&mut self,
resources_config_path: &Path
) -> &mut Aapt2Optimize
Path to the resources.cfg
file containing the list of resources and directives
to each resource. Format: type/resource_name#[directive][,directive]
sourcepub fn configs_to_include(
&mut self,
configs_to_include: &str
) -> &mut Aapt2Optimize
pub fn configs_to_include(
&mut self,
configs_to_include: &str
) -> &mut Aapt2Optimize
Comma separated list of configurations to include. The default is all configurations
sourcepub fn split(&mut self, split: &Path) -> &mut Aapt2Optimize
pub fn split(&mut self, split: &Path) -> &mut Aapt2Optimize
Split resources matching a set of configs out to a Split APK. Syntax:
`path/to/output.apk;<config>[,<config>[...]].`
On Windows, use a semicolon ;
separator instead
sourcepub fn keep_artifacts(&mut self, keep_artifacts: &str) -> &mut Aapt2Optimize
pub fn keep_artifacts(&mut self, keep_artifacts: &str) -> &mut Aapt2Optimize
Comma separated list of artifacts to keep. If none are specified, all artifacts will be kept
sourcepub fn enable_sparse_encoding(
&mut self,
enable_sparse_encoding: bool
) -> &mut Aapt2Optimize
pub fn enable_sparse_encoding(
&mut self,
enable_sparse_encoding: bool
) -> &mut Aapt2Optimize
Enables encoding sparse entries using a binary search tree. This decreases APK size at the cost of resource retrieval performance
sourcepub fn collapse_resource_name(
&mut self,
collapse_resource_name: bool
) -> &mut Aapt2Optimize
pub fn collapse_resource_name(
&mut self,
collapse_resource_name: bool
) -> &mut Aapt2Optimize
Collapses resource names to a single value in the key string pool.
Resources can be exempted using the no_collapse
directive in a file specified by
--resources-config-path
sourcepub fn shorten_resource_paths(
&mut self,
shorten_resource_paths: bool
) -> &mut Aapt2Optimize
pub fn shorten_resource_paths(
&mut self,
shorten_resource_paths: bool
) -> &mut Aapt2Optimize
Shortens the paths of resources inside the APK
sourcepub fn resource_path_shortening_map(
&mut self,
resource_path_shortening_map: &Path
) -> &mut Aapt2Optimize
pub fn resource_path_shortening_map(
&mut self,
resource_path_shortening_map: &Path
) -> &mut Aapt2Optimize
Path to output the map of old resource paths to shortened paths
sourcepub fn verbose(&mut self, verbose: bool) -> &mut Aapt2Optimize
pub fn verbose(&mut self, verbose: bool) -> &mut Aapt2Optimize
Enables verbose logging
sourcepub fn help(&mut self, help: bool) -> &mut Aapt2Optimize
pub fn help(&mut self, help: bool) -> &mut Aapt2Optimize
Displays this help menu
Trait Implementations
sourceimpl Clone for Aapt2Optimize
impl Clone for Aapt2Optimize
sourcefn clone(&self) -> Aapt2Optimize
fn clone(&self) -> Aapt2Optimize
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for Aapt2Optimize
impl Default for Aapt2Optimize
sourcefn default() -> Aapt2Optimize
fn default() -> Aapt2Optimize
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for Aapt2Optimize
impl Send for Aapt2Optimize
impl Sync for Aapt2Optimize
impl Unpin for Aapt2Optimize
impl UnwindSafe for Aapt2Optimize
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more