Kaynağa Gözat

feat(core): set default value for `minimum_system_version` to 10.13 (#3497)

Lucas Fernandes Nogueira 3 yıl önce
ebeveyn
işleme
fce344b90b

+ 6 - 0
.changes/minimum-mac-version.md

@@ -0,0 +1,6 @@
+---
+"tauri-utils": patch
+"tauri": patch
+---
+
+Changed the default value for `tauri > bundle > macOS > minimumSystemVersion` to `10.13`.

+ 24 - 2
core/tauri-utils/src/config.rs

@@ -96,7 +96,7 @@ pub struct DebConfig {
 
 /// Configuration for the macOS bundles.
 #[skip_serializing_none]
-#[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize)]
+#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
 #[cfg_attr(feature = "schema", derive(JsonSchema))]
 #[serde(rename_all = "camelCase", deny_unknown_fields)]
 pub struct MacConfig {
@@ -104,7 +104,10 @@ 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.
   pub frameworks: Option<Vec<String>>,
-  /// A version string indicating the minimum macOS X version that the bundled application supports.
+  /// 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.
+  #[serde(default = "minimum_system_version")]
   pub minimum_system_version: Option<String>,
   /// Allows your application to communicate with the outside world.
   /// It should be a lowercase, without port and protocol domain name.
@@ -122,6 +125,25 @@ pub struct MacConfig {
   pub entitlements: Option<String>,
 }
 
+impl Default for MacConfig {
+  fn default() -> Self {
+    Self {
+      frameworks: None,
+      minimum_system_version: minimum_system_version(),
+      exception_domain: None,
+      license: None,
+      use_bootstrapper: false,
+      signing_identity: None,
+      provider_short_name: None,
+      entitlements: None,
+    }
+  }
+}
+
+fn minimum_system_version() -> Option<String> {
+  Some("10.13".into())
+}
+
 /// Configuration for a target language for the WiX build.
 #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
 #[cfg_attr(feature = "schema", derive(JsonSchema))]

+ 5 - 1
tooling/cli/schema.json

@@ -140,6 +140,7 @@
           "icon": [],
           "identifier": "",
           "macOS": {
+            "minimumSystemVersion": "10.13",
             "useBootstrapper": false
           },
           "windows": {
@@ -519,6 +520,7 @@
         "macOS": {
           "description": "Configuration for the macOS bundles.",
           "default": {
+            "minimumSystemVersion": "10.13",
             "useBootstrapper": false
           },
           "allOf": [
@@ -1082,7 +1084,8 @@
           ]
         },
         "minimumSystemVersion": {
-          "description": "A version string indicating the minimum macOS X version that the bundled application supports.",
+          "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.",
+          "default": "10.13",
           "type": [
             "string",
             "null"
@@ -1563,6 +1566,7 @@
             "icon": [],
             "identifier": "",
             "macOS": {
+              "minimumSystemVersion": "10.13",
               "useBootstrapper": false
             },
             "windows": {