mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 11:41:56 +00:00
refactor(cli): reorder a few parameters (#14792)
This commit is contained in:
parent
ea31b07f19
commit
10a8066db3
@ -104,7 +104,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
|
|||||||
|
|
||||||
let mut interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?;
|
let mut interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?;
|
||||||
|
|
||||||
setup(&interface, &mut options, &config, false, &dirs)?;
|
setup(&interface, &mut options, &config, &dirs, false)?;
|
||||||
|
|
||||||
if let Some(minimum_system_version) = &config.bundle.macos.minimum_system_version {
|
if let Some(minimum_system_version) = &config.bundle.macos.minimum_system_version {
|
||||||
std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version);
|
std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version);
|
||||||
@ -129,8 +129,8 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
|
|||||||
&interface,
|
&interface,
|
||||||
&*app_settings,
|
&*app_settings,
|
||||||
&config,
|
&config,
|
||||||
&out_dir,
|
|
||||||
&dirs,
|
&dirs,
|
||||||
|
&out_dir,
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +141,8 @@ pub fn setup(
|
|||||||
interface: &AppInterface,
|
interface: &AppInterface,
|
||||||
options: &mut Options,
|
options: &mut Options,
|
||||||
config: &ConfigMetadata,
|
config: &ConfigMetadata,
|
||||||
mobile: bool,
|
|
||||||
dirs: &Dirs,
|
dirs: &Dirs,
|
||||||
|
mobile: bool,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
// TODO: Maybe optimize this to run in parallel in the future
|
// TODO: Maybe optimize this to run in parallel in the future
|
||||||
// see https://github.com/tauri-apps/tauri/pull/13993#discussion_r2280697117
|
// see https://github.com/tauri-apps/tauri/pull/13993#discussion_r2280697117
|
||||||
|
|||||||
@ -154,8 +154,8 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> {
|
|||||||
&interface,
|
&interface,
|
||||||
&*app_settings,
|
&*app_settings,
|
||||||
&config,
|
&config,
|
||||||
&out_dir,
|
|
||||||
&dirs,
|
&dirs,
|
||||||
|
&out_dir,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,8 +167,8 @@ pub fn bundle<A: AppSettings>(
|
|||||||
interface: &AppInterface,
|
interface: &AppInterface,
|
||||||
app_settings: &A,
|
app_settings: &A,
|
||||||
config: &ConfigMetadata,
|
config: &ConfigMetadata,
|
||||||
out_dir: &Path,
|
|
||||||
dirs: &Dirs,
|
dirs: &Dirs,
|
||||||
|
out_dir: &Path,
|
||||||
) -> crate::Result<()> {
|
) -> crate::Result<()> {
|
||||||
let package_types: Vec<PackageType> = if let Some(bundles) = &options.bundles {
|
let package_types: Vec<PackageType> = if let Some(bundles) = &options.bundles {
|
||||||
bundles.iter().map(|bundle| bundle.0).collect::<Vec<_>>()
|
bundles.iter().map(|bundle| bundle.0).collect::<Vec<_>>()
|
||||||
|
|||||||
@ -55,8 +55,7 @@ impl ConfigMetadata {
|
|||||||
for (ext, config) in &self.extensions {
|
for (ext, config) in &self.extensions {
|
||||||
if let Some(identifier) = config
|
if let Some(identifier) = config
|
||||||
.as_object()
|
.as_object()
|
||||||
.and_then(|bundle_config| bundle_config.get("identifier"))
|
.and_then(|bundle_config| bundle_config.get("identifier")?.as_str())
|
||||||
.and_then(|id| id.as_str())
|
|
||||||
{
|
{
|
||||||
if identifier == self.inner.identifier {
|
if identifier == self.inner.identifier {
|
||||||
return Some(ext.clone());
|
return Some(ext.clone());
|
||||||
@ -163,8 +162,7 @@ fn load_config(
|
|||||||
|
|
||||||
let original_identifier = config
|
let original_identifier = config
|
||||||
.as_object()
|
.as_object()
|
||||||
.and_then(|config| config.get("identifier"))
|
.and_then(|config| config.get("identifier")?.as_str())
|
||||||
.and_then(|id| id.as_str())
|
|
||||||
.map(ToString::to_string);
|
.map(ToString::to_string);
|
||||||
|
|
||||||
if let Some((platform_config, config_path)) =
|
if let Some((platform_config, config_path)) =
|
||||||
|
|||||||
@ -351,10 +351,7 @@ mod tests {
|
|||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
if let Some(f) = item_table
|
if let Some(f) = item_table.and_then(|t| t.get("features")?.as_array().cloned()) {
|
||||||
.and_then(|t| t.get("features").cloned())
|
|
||||||
.and_then(|f| f.as_array().cloned())
|
|
||||||
{
|
|
||||||
for feature in f.iter() {
|
for feature in f.iter() {
|
||||||
let feature = feature.as_str().expect("feature is not a string");
|
let feature = feature.as_str().expect("feature is not a string");
|
||||||
if !dep.all_cli_managed_features.contains(&feature) {
|
if !dep.all_cli_managed_features.contains(&feature) {
|
||||||
|
|||||||
@ -188,7 +188,7 @@ pub fn run(
|
|||||||
|
|
||||||
generate_tauri_properties(&config, tauri_config, false)?;
|
generate_tauri_properties(&config, tauri_config, false)?;
|
||||||
|
|
||||||
crate::build::setup(&interface, &mut build_options, tauri_config, true, dirs)?;
|
crate::build::setup(&interface, &mut build_options, tauri_config, dirs, true)?;
|
||||||
|
|
||||||
let installed_targets =
|
let installed_targets =
|
||||||
crate::interface::rust::installation::installed_targets().unwrap_or_default();
|
crate::interface::rust::installation::installed_targets().unwrap_or_default();
|
||||||
|
|||||||
@ -357,7 +357,7 @@ fn run_build(
|
|||||||
Profile::Release
|
Profile::Release
|
||||||
};
|
};
|
||||||
|
|
||||||
crate::build::setup(interface, &mut build_options, &tauri_config, true, dirs)?;
|
crate::build::setup(interface, &mut build_options, &tauri_config, dirs, true)?;
|
||||||
|
|
||||||
let app_settings = interface.app_settings();
|
let app_settings = interface.app_settings();
|
||||||
let out_dir = app_settings.out_dir(
|
let out_dir = app_settings.out_dir(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user