mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-08-17 03:40:23 +03:00
chore(cli): enhance mobile build by only compiling selected target (#9894)
Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
This commit is contained in:
parent
71a5e2ba24
commit
3f1c59d684
@ -89,13 +89,17 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
|
||||
delete_codegen_vars();
|
||||
|
||||
let mut build_options: BuildOptions = options.clone().into();
|
||||
build_options.target = Some(
|
||||
Target::all()
|
||||
.get(Target::DEFAULT_KEY)
|
||||
.unwrap()
|
||||
.triple
|
||||
.into(),
|
||||
);
|
||||
|
||||
let first_target = Target::all()
|
||||
.get(
|
||||
options
|
||||
.targets
|
||||
.as_ref()
|
||||
.and_then(|l| l.first().map(|t| t.as_str()))
|
||||
.unwrap_or(Target::DEFAULT_KEY),
|
||||
)
|
||||
.unwrap();
|
||||
build_options.target = Some(first_target.triple.into());
|
||||
|
||||
let tauri_config = get_tauri_config(
|
||||
tauri_utils::platform::Target::Android,
|
||||
@ -138,14 +142,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
|
||||
crate::build::setup(&interface, &mut build_options, tauri_config.clone(), true)?;
|
||||
|
||||
// run an initial build to initialize plugins
|
||||
Target::all().values().next().unwrap().build(
|
||||
&config,
|
||||
&metadata,
|
||||
&env,
|
||||
noise_level,
|
||||
true,
|
||||
profile,
|
||||
)?;
|
||||
first_target.build(&config, &metadata, &env, noise_level, true, profile)?;
|
||||
|
||||
let open = options.open;
|
||||
let _handle = run_build(
|
||||
|
@ -85,7 +85,13 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> {
|
||||
let mut build_options: BuildOptions = options.clone().into();
|
||||
build_options.target = Some(
|
||||
Target::all()
|
||||
.get(Target::DEFAULT_KEY)
|
||||
.get(
|
||||
options
|
||||
.targets
|
||||
.first()
|
||||
.map(|t| t.as_str())
|
||||
.unwrap_or(Target::DEFAULT_KEY),
|
||||
)
|
||||
.unwrap()
|
||||
.triple
|
||||
.into(),
|
||||
|
Loading…
Reference in New Issue
Block a user