Skip to content

Commit

Permalink
fix(core/cli): Add custom default implementation for ios config (#1…
Browse files Browse the repository at this point in the history
…0533)

* fix(cli): Add custom `default` implementation for ios config

* fix change
  • Loading branch information
FabianLars authored Aug 8, 2024
1 parent 5f56cb0 commit f5dfc02
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changes/ios-default-minversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'tauri-utils': 'patch:bug'
'tauri-cli': 'patch:bug'
'@tauri-apps/cli': 'patch:bug'
---

Fixed an issue causing `tauri ios init` to fail if `iOS.minimumSystemVersion` was not configured explicitly.
4 changes: 2 additions & 2 deletions core/tauri-config-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"createUpdaterArtifacts": false,
"iOS": {
"minimumSystemVersion": ""
"minimumSystemVersion": "13.0"
},
"icon": [],
"linux": {
Expand Down Expand Up @@ -1715,7 +1715,7 @@
"iOS": {
"description": "iOS configuration.",
"default": {
"minimumSystemVersion": ""
"minimumSystemVersion": "13.0"
},
"allOf": [
{
Expand Down
13 changes: 12 additions & 1 deletion core/tauri-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ pub struct TrayIconConfig {

/// General configuration for the iOS target.
#[skip_serializing_none]
#[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
#[cfg_attr(feature = "schema", derive(JsonSchema))]
#[serde(rename_all = "camelCase", deny_unknown_fields)]
pub struct IosConfig {
Expand All @@ -1915,6 +1915,17 @@ pub struct IosConfig {
pub minimum_system_version: String,
}

impl Default for IosConfig {
fn default() -> Self {
Self {
template: None,
frameworks: None,
development_team: None,
minimum_system_version: ios_minimum_system_version(),
}
}
}

/// General configuration for the iOS target.
#[skip_serializing_none]
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
Expand Down
4 changes: 2 additions & 2 deletions tooling/cli/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"createUpdaterArtifacts": false,
"iOS": {
"minimumSystemVersion": ""
"minimumSystemVersion": "13.0"
},
"icon": [],
"linux": {
Expand Down Expand Up @@ -1715,7 +1715,7 @@
"iOS": {
"description": "iOS configuration.",
"default": {
"minimumSystemVersion": ""
"minimumSystemVersion": "13.0"
},
"allOf": [
{
Expand Down

0 comments on commit f5dfc02

Please sign in to comment.