mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:37:09 +00:00
fix(cli): load --config values on xcode and android-studio scripts (#13730)
This commit is contained in:
parent
0079d08ba9
commit
cbd9629729
6
.changes/load-config-merges-mobile.md
Normal file
6
.changes/load-config-merges-mobile.md
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
Load `--config` arguments when running the Xcode and Android Studio build scripts.
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
use super::{detect_target_ok, ensure_init, env, get_app, get_config, read_options, MobileTarget};
|
||||
use crate::{
|
||||
helpers::config::get as get_tauri_config,
|
||||
helpers::config::{get as get_tauri_config, reload as reload_tauri_config},
|
||||
interface::{AppInterface, Interface},
|
||||
mobile::CliOptions,
|
||||
Result,
|
||||
@ -46,12 +46,33 @@ pub fn command(options: Options) -> Result<()> {
|
||||
Profile::Debug
|
||||
};
|
||||
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Android, &[])?;
|
||||
let (tauri_config, cli_options) = {
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, &[])?;
|
||||
let cli_options = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
read_options(tauri_config_)
|
||||
};
|
||||
|
||||
let (config, metadata, cli_options) = {
|
||||
let tauri_config = if cli_options.config.is_empty() {
|
||||
tauri_config
|
||||
} else {
|
||||
// reload config with merges from the android dev|build script
|
||||
reload_tauri_config(
|
||||
&cli_options
|
||||
.config
|
||||
.iter()
|
||||
.map(|conf| &conf.0)
|
||||
.collect::<Vec<_>>(),
|
||||
)?
|
||||
};
|
||||
|
||||
(tauri_config, cli_options)
|
||||
};
|
||||
|
||||
let (config, metadata) = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
let cli_options = read_options(tauri_config_);
|
||||
let (config, metadata) = get_config(
|
||||
&get_app(
|
||||
MobileTarget::Android,
|
||||
@ -62,7 +83,7 @@ pub fn command(options: Options) -> Result<()> {
|
||||
None,
|
||||
&cli_options,
|
||||
);
|
||||
(config, metadata, cli_options)
|
||||
(config, metadata)
|
||||
};
|
||||
|
||||
ensure_init(
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
use super::{ensure_init, env, get_app, get_config, read_options, MobileTarget};
|
||||
use crate::{
|
||||
helpers::config::get as get_tauri_config,
|
||||
helpers::config::{get as get_tauri_config, reload as reload_tauri_config},
|
||||
interface::{AppInterface, Interface, Options as InterfaceOptions},
|
||||
mobile::ios::LIB_OUTPUT_FILE_NAME,
|
||||
Result,
|
||||
@ -82,9 +82,30 @@ pub fn command(options: Options) -> Result<()> {
|
||||
let profile = profile_from_configuration(&options.configuration);
|
||||
let macos = macos_from_platform(&options.platform);
|
||||
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, &[])?;
|
||||
let (tauri_config, cli_options) = {
|
||||
let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, &[])?;
|
||||
let cli_options = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
read_options(tauri_config_)
|
||||
};
|
||||
let tauri_config = if cli_options.config.is_empty() {
|
||||
tauri_config
|
||||
} else {
|
||||
// reload config with merges from the ios dev|build script
|
||||
reload_tauri_config(
|
||||
&cli_options
|
||||
.config
|
||||
.iter()
|
||||
.map(|conf| &conf.0)
|
||||
.collect::<Vec<_>>(),
|
||||
)?
|
||||
};
|
||||
|
||||
let (config, metadata, cli_options) = {
|
||||
(tauri_config, cli_options)
|
||||
};
|
||||
|
||||
let (config, metadata) = {
|
||||
let tauri_config_guard = tauri_config.lock().unwrap();
|
||||
let tauri_config_ = tauri_config_guard.as_ref().unwrap();
|
||||
let cli_options = read_options(tauri_config_);
|
||||
@ -98,7 +119,7 @@ pub fn command(options: Options) -> Result<()> {
|
||||
None,
|
||||
&cli_options,
|
||||
)?;
|
||||
(config, metadata, cli_options)
|
||||
(config, metadata)
|
||||
};
|
||||
ensure_init(
|
||||
&tauri_config,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user