-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
None empty #14607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
None empty #14607
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@tauri-apps/cli": patch:enhance | ||
| "tauri-cli": patch:enhance | ||
| --- | ||
|
|
||
| Replace Option<Vec> with simple Vec |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -128,19 +128,18 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> { | |
| pub fn get_config( | ||
| app: &App, | ||
| config: &TauriConfig, | ||
| features: Option<&Vec<String>>, | ||
| features: &[String], | ||
| cli_options: &CliOptions, | ||
| ) -> (AndroidConfig, AndroidMetadata) { | ||
| let mut android_options = cli_options.clone(); | ||
| if let Some(features) = features { | ||
| android_options | ||
| .features | ||
| .get_or_insert(Vec::new()) | ||
| .extend_from_slice(features); | ||
| } | ||
| android_options.features.extend_from_slice(features); | ||
|
|
||
| let raw = RawAndroidConfig { | ||
| features: android_options.features.clone(), | ||
| features: if android_options.features.is_empty() { | ||
| None | ||
| } else { | ||
| Some(android_options.features.clone()) | ||
| }, | ||
|
Comment on lines
+138
to
+142
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did not check how this external type behaves, so this if branch might be overly conservative and replaceable with
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's being used at all currently, so wouldn't matter either ways
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll check, just to make sure this is future-proof, even if it's not used. Alternatively, if things are not used, should we remove them?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'm not the most familiar with it, maybe @lucasfernog knows about them a bit more |
||
| logcat_filter_specs: vec![ | ||
| "RustStdoutStderr".into(), | ||
| format!( | ||
|
|
@@ -161,7 +160,11 @@ pub fn get_config( | |
| let metadata = AndroidMetadata { | ||
| supported: true, | ||
| cargo_args: Some(android_options.args), | ||
| features: android_options.features, | ||
| features: if android_options.features.is_empty() { | ||
| None | ||
| } else { | ||
| Some(android_options.features) | ||
| }, | ||
|
Comment on lines
-164
to
+167
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, if branch maybe removable. |
||
| ..Default::default() | ||
| }; | ||
|
|
||
|
|
@@ -257,8 +260,8 @@ fn ensure_java() -> Result<()> { | |
|
|
||
| fn ensure_sdk(non_interactive: bool) -> Result<()> { | ||
| let android_home = std::env::var_os("ANDROID_HOME") | ||
| .map(PathBuf::from) | ||
| .or_else(|| std::env::var_os("ANDROID_SDK_ROOT").map(PathBuf::from)); | ||
| .or_else(|| std::env::var_os("ANDROID_SDK_ROOT")) | ||
| .map(PathBuf::from); | ||
| if !android_home.as_ref().is_some_and(|v| v.exists()) { | ||
| log::info!( | ||
| "ANDROID_HOME {}, trying to locate Android SDK...", | ||
|
|
@@ -354,8 +357,8 @@ fn ensure_sdk(non_interactive: bool) -> Result<()> { | |
| fn ensure_ndk(non_interactive: bool) -> Result<()> { | ||
| // re-evaluate ANDROID_HOME | ||
| let android_home = std::env::var_os("ANDROID_HOME") | ||
| .or_else(|| std::env::var_os("ANDROID_SDK_ROOT")) | ||
| .map(PathBuf::from) | ||
| .or_else(|| std::env::var_os("ANDROID_SDK_ROOT").map(PathBuf::from)) | ||
| .context("Failed to locate Android SDK")?; | ||
| let mut installed_ndks = read_dir(android_home.join("ndk")) | ||
| .map(|dir| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,7 @@ use crate::{ | |
| use std::{ | ||
| env::{set_var, var_os}, | ||
| fs::create_dir_all, | ||
| path::PathBuf, | ||
| path::Path, | ||
| str::FromStr, | ||
| thread::sleep, | ||
| time::Duration, | ||
|
|
@@ -126,16 +126,11 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> { | |
| pub fn get_config( | ||
| app: &App, | ||
| tauri_config: &TauriConfig, | ||
| features: Option<&Vec<String>>, | ||
| features: &[String], | ||
| cli_options: &CliOptions, | ||
| ) -> Result<(AppleConfig, AppleMetadata)> { | ||
| let mut ios_options = cli_options.clone(); | ||
| if let Some(features) = features { | ||
| ios_options | ||
| .features | ||
| .get_or_insert(Vec::new()) | ||
| .extend_from_slice(features); | ||
| } | ||
| ios_options.features.extend_from_slice(features); | ||
|
|
||
| let bundle_version = if let Some(bundle_version) = tauri_config | ||
| .bundle | ||
|
|
@@ -232,7 +227,11 @@ pub fn get_config( | |
| } | ||
| } | ||
| }), | ||
| ios_features: ios_options.features.clone(), | ||
| ios_features: if ios_options.features.is_empty() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| None | ||
| } else { | ||
| Some(ios_options.features.clone()) | ||
| }, | ||
| bundle_version, | ||
| bundle_version_short, | ||
| ios_version: Some(tauri_config.bundle.ios.minimum_system_version.clone()), | ||
|
|
@@ -252,7 +251,7 @@ pub fn get_config( | |
| .clone() | ||
| .unwrap_or_default() | ||
| { | ||
| let framework_path = PathBuf::from(&framework); | ||
| let framework_path = Path::new(&framework); | ||
| let ext = framework_path.extension().unwrap_or_default(); | ||
| if ext.is_empty() { | ||
| frameworks.push(framework); | ||
|
|
@@ -277,7 +276,11 @@ pub fn get_config( | |
| supported: true, | ||
| ios: ApplePlatform { | ||
| cargo_args: Some(ios_options.args), | ||
| features: ios_options.features, | ||
| features: if ios_options.features.is_empty() { | ||
| None | ||
| } else { | ||
| Some(ios_options.features) | ||
| }, | ||
| frameworks: Some(frameworks), | ||
| vendor_frameworks: Some(vendor_frameworks), | ||
| ..Default::default() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code previously had different behavior if options.features was
Some(Vec::new())(continuehit) vsNone(continuenot hit). This is odd given the variable names which imply the required features should be present.