feat(cli): use default macOS minimum system version when it is empty (#3658)

This commit is contained in:
Lucas Fernandes Nogueira 2022-03-13 11:20:11 -03:00 committed by GitHub
parent 9258aed114
commit c81534ebd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 30 additions and 18 deletions

View File

@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---
Remove `minimumSystemVersion: null` from the application template configuration.

View File

@ -0,0 +1,5 @@
---
"tauri-utils": patch
---
Use the default value for `MacConfig.minimumSystemVersion` if the value is set to an empty string.

View File

@ -99,6 +99,17 @@ pub struct DebConfig {
pub files: HashMap<PathBuf, PathBuf>, pub files: HashMap<PathBuf, PathBuf>,
} }
fn de_minimum_system_version<'de, D>(deserializer: D) -> Result<Option<String>, D::Error>
where
D: Deserializer<'de>,
{
let version = Option::<String>::deserialize(deserializer)?;
match version {
Some(v) if v.is_empty() => Ok(minimum_system_version()),
e => Ok(e),
}
}
/// Configuration for the macOS bundles. /// Configuration for the macOS bundles.
#[skip_serializing_none] #[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)] #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
@ -110,9 +121,15 @@ pub struct MacConfig {
/// If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework. /// If a name is used, ".framework" must be omitted and it will look for standard install locations. You may also use a path to a specific framework.
pub frameworks: Option<Vec<String>>, pub frameworks: Option<Vec<String>>,
/// A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`. /// A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.
///
/// Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist` /// Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist`
/// and the `MACOSX_DEPLOYMENT_TARGET` environment variable. /// and the `MACOSX_DEPLOYMENT_TARGET` environment variable.
#[serde(default = "minimum_system_version")] ///
/// An empty string is considered an invalid value so the default value is used.
#[serde(
deserialize_with = "de_minimum_system_version",
default = "minimum_system_version"
)]
pub minimum_system_version: Option<String>, pub minimum_system_version: Option<String>,
/// Allows your application to communicate with the outside world. /// Allows your application to communicate with the outside world.
/// It should be a lowercase, without port and protocol domain name. /// It should be a lowercase, without port and protocol domain name.

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -29,7 +29,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -40,7 +40,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "", "exceptionDomain": "",
"signingIdentity": null, "signingIdentity": null,

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -29,7 +29,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -31,7 +31,6 @@
"signingIdentity": null, "signingIdentity": null,
"entitlements": "../entitlements.plist", "entitlements": "../entitlements.plist",
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
}, },

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -30,7 +30,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }

View File

@ -1145,7 +1145,7 @@
] ]
}, },
"minimumSystemVersion": { "minimumSystemVersion": {
"description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`. Setting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist` and the `MACOSX_DEPLOYMENT_TARGET` environment variable.", "description": "A version string indicating the minimum macOS X version that the bundled application supports. Defaults to `10.13`.\n\nSetting it to `null` completely removes the `LSMinimumSystemVersion` field on the bundle's `Info.plist` and the `MACOSX_DEPLOYMENT_TARGET` environment variable.\n\nAn empty string is considered an invalid value so the default value is used.",
"default": "10.13", "default": "10.13",
"type": [ "type": [
"string", "string",

View File

@ -33,7 +33,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "", "exceptionDomain": "",
"signingIdentity": null, "signingIdentity": null,

View File

@ -31,7 +31,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "", "exceptionDomain": "",
"signingIdentity": null, "signingIdentity": null,

View File

@ -29,7 +29,6 @@
}, },
"macOS": { "macOS": {
"frameworks": [], "frameworks": [],
"minimumSystemVersion": "",
"useBootstrapper": false, "useBootstrapper": false,
"exceptionDomain": "" "exceptionDomain": ""
} }