Struct crossbundle_lib::commands::build::android::AndroidBuildCommand
source · [−]pub struct AndroidBuildCommand {
pub shared: SharedBuildCommand,
pub target: Vec<AndroidTarget>,
pub strategy: AndroidStrategy,
pub lib: Option<String>,
pub export_path: Option<PathBuf>,
pub sign_key_path: Option<PathBuf>,
pub sign_key_pass: Option<String>,
pub sign_key_alias: Option<String>,
}
Expand description
Specifies flags and options needed to build application
Fields
target: Vec<AndroidTarget>
Build for the given android architecture.
Supported targets are: armv7-linux-androideabi
, aarch64-linux-android
,
i686-linux-android
, x86_64-linux-android
strategy: AndroidStrategy
Build strategy specifies what and how to build Android application: with help of Gradle, or with our native approach.
lib: Option<String>
Only compile rust code as a dynamic library. By default: “crossbow-android”
export_path: Option<PathBuf>
Path to export Gradle project. By default exports to target/android/
folder.
sign_key_path: Option<PathBuf>
Path to the signing key.
sign_key_pass: Option<String>
Signing key password.
sign_key_alias: Option<String>
Signing key alias.
Implementations
sourceimpl AndroidBuildCommand
impl AndroidBuildCommand
pub fn run(&self, config: &Config) -> Result<()>
sourcepub fn build_gradle(
&self,
config: &Config,
context: &BuildContext,
export_path: &Option<PathBuf>
) -> Result<(AndroidManifest, AndroidSdk, PathBuf)>
pub fn build_gradle(
&self,
config: &Config,
context: &BuildContext,
export_path: &Option<PathBuf>
) -> Result<(AndroidManifest, AndroidSdk, PathBuf)>
Compile rust code as a dynamic library, generate Gradle project.
sourcepub fn build_rust_lib(
&self,
config: &Config,
context: &BuildContext,
lib_name: &str,
export_path: Option<PathBuf>
) -> Result<()>
pub fn build_rust_lib(
&self,
config: &Config,
context: &BuildContext,
lib_name: &str,
export_path: Option<PathBuf>
) -> Result<()>
Compile rust code as a dynamic library.
sourcepub fn execute_apk(
&self,
config: &Config,
context: &BuildContext
) -> Result<(AndroidManifest, AndroidSdk, PathBuf)>
pub fn execute_apk(
&self,
config: &Config,
context: &BuildContext
) -> Result<(AndroidManifest, AndroidSdk, PathBuf)>
Builds APK with aapt tool and signs it with apksigner.
sourcepub fn execute_aab(
&self,
config: &Config,
context: &BuildContext
) -> Result<(AndroidManifest, AndroidSdk, PathBuf, String, Key)>
pub fn execute_aab(
&self,
config: &Config,
context: &BuildContext
) -> Result<(AndroidManifest, AndroidSdk, PathBuf, String, Key)>
Builds AAB with aapt2 tool and signs it with jarsigner.
sourcepub fn needed_project_dirs(
example: Option<&String>,
context: &BuildContext
) -> Result<(PathBuf, PathBuf, String)>
pub fn needed_project_dirs(
example: Option<&String>,
context: &BuildContext
) -> Result<(PathBuf, PathBuf, String)>
Specifies project path and target directory needed to build application.
sourcepub fn android_toolchain() -> Result<(AndroidSdk, AndroidNdk)>
pub fn android_toolchain() -> Result<(AndroidSdk, AndroidNdk)>
Specifies path to Android SDK and Android NDK.
sourcepub fn find_keystore(
sign_key_path: Option<PathBuf>,
sign_key_pass: Option<String>,
sign_key_alias: Option<String>
) -> Result<Key>
pub fn find_keystore(
sign_key_path: Option<PathBuf>,
sign_key_pass: Option<String>,
sign_key_alias: Option<String>
) -> Result<Key>
Find keystore for signing application or create it.
sourcepub fn build_target(
&self,
context: &BuildContext,
build_targets: Vec<AndroidTarget>,
package_name: &str,
ndk: &AndroidNdk,
project_path: &Path,
profile: Profile,
target_sdk_version: u32,
target_dir: &Path,
config: &Config
) -> Result<Vec<(PathBuf, AndroidTarget)>>
pub fn build_target(
&self,
context: &BuildContext,
build_targets: Vec<AndroidTarget>,
package_name: &str,
ndk: &AndroidNdk,
project_path: &Path,
profile: Profile,
target_sdk_version: u32,
target_dir: &Path,
config: &Config
) -> Result<Vec<(PathBuf, AndroidTarget)>>
Compiling libs for architecture and write out it in vector.
sourcepub fn target_sdk_version(
android_manifest: &AndroidManifest,
sdk: &AndroidSdk
) -> u32
pub fn target_sdk_version(
android_manifest: &AndroidManifest,
sdk: &AndroidSdk
) -> u32
Get target sdk version from cargo manifest
sourcepub fn min_sdk_version(android_manifest: &AndroidManifest) -> u32
pub fn min_sdk_version(android_manifest: &AndroidManifest) -> u32
Get min sdk version from cargo manifest
sourcepub fn android_build_targets(
context: &BuildContext,
profile: Profile,
build_targets: &Vec<AndroidTarget>
) -> Vec<AndroidTarget>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn android_build_targets(
context: &BuildContext,
profile: Profile,
build_targets: &Vec<AndroidTarget>
) -> Vec<AndroidTarget>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Get android build targets from cargo manifest
sourcepub fn get_android_manifest(
context: &BuildContext,
strategy: AndroidStrategy
) -> Result<AndroidManifest>
pub fn get_android_manifest(
context: &BuildContext,
strategy: AndroidStrategy
) -> Result<AndroidManifest>
Get android manifest from the path in cargo manifest or generate it with the given configuration
sourcepub fn prepare_assets_and_resources(
config: &CrossbowMetadata,
out_dir: &Path
) -> Result<(Option<PathBuf>, Option<PathBuf>)>
pub fn prepare_assets_and_resources(
config: &CrossbowMetadata,
out_dir: &Path
) -> Result<(Option<PathBuf>, Option<PathBuf>)>
Prepare assets and resources for the application.
Also, this function will generate mipmap icon resources if specified in the CrossbowMetadata config.
Trait Implementations
sourceimpl Args for AndroidBuildCommand
impl Args for AndroidBuildCommand
sourceimpl Clone for AndroidBuildCommand
impl Clone for AndroidBuildCommand
sourcefn clone(&self) -> AndroidBuildCommand
fn clone(&self) -> AndroidBuildCommand
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 CommandFactory for AndroidBuildCommand
impl CommandFactory for AndroidBuildCommand
sourcefn into_app_for_update<'b>() -> Command<'b>
fn into_app_for_update<'b>() -> Command<'b>
Deprecated, replaced with CommandFactory::command_for_update
sourcefn command_for_update<'help>() -> App<'help>
fn command_for_update<'help>() -> App<'help>
sourceimpl Debug for AndroidBuildCommand
impl Debug for AndroidBuildCommand
sourceimpl Default for AndroidBuildCommand
impl Default for AndroidBuildCommand
sourcefn default() -> AndroidBuildCommand
fn default() -> AndroidBuildCommand
Returns the “default value” for a type. Read more
sourceimpl FromArgMatches for AndroidBuildCommand
impl FromArgMatches for AndroidBuildCommand
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
Instantiate Self
from ArgMatches
, parsing the arguments as needed. Read more
sourcefn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches
to self
.
sourcefn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches
to self
.
sourceimpl Parser for AndroidBuildCommand
impl Parser for AndroidBuildCommand
sourcefn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn parse_from<I, T>(itr: I) -> Selfwhere
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, exit on error
sourcefn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Parse from iterator, return Err on error.
sourcefn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn update_from<I, T>(&mut self, itr: I)where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, exit on error
sourcefn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where
I: IntoIterator<Item = T>,
T: Into<OsString> + Clone,
Update from iterator, return Err on error.
Auto Trait Implementations
impl RefUnwindSafe for AndroidBuildCommand
impl Send for AndroidBuildCommand
impl Sync for AndroidBuildCommand
impl Unpin for AndroidBuildCommand
impl UnwindSafe for AndroidBuildCommand
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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