From 7796a8fc649cd7397a67048c71f8d1fbf822122a Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 19 Aug 2024 16:29:16 -0300 Subject: [PATCH] fix(cli): adapt Package.swift to work on older Swift versions (#10687) I noticed the plugin build fails on older Swift (tested on macOS 12) because the default minimum required macOS version (10.10 in my case) is older than `v10_13` which is set by the Tauri iOS package (and also swift-rs). So the plugins must explicitly define a minimum macOS version too. --- .changes/fix-ios-build-older-swift.md | 6 ++++++ .../api/src-tauri/tauri-plugin-sample/ios/Package.swift | 1 + tooling/cli/templates/plugin/ios-spm/Package.swift | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changes/fix-ios-build-older-swift.md diff --git a/.changes/fix-ios-build-older-swift.md b/.changes/fix-ios-build-older-swift.md new file mode 100644 index 000000000..c5e6d8990 --- /dev/null +++ b/.changes/fix-ios-build-older-swift.md @@ -0,0 +1,6 @@ +--- +'tauri-cli': 'patch:bug' +'@tauri-apps/cli': 'patch:bug' +--- + +Fix Swift plugin compilation on older versions. diff --git a/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift b/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift index d0aa2fbfa..db42f770c 100644 --- a/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift +++ b/examples/api/src-tauri/tauri-plugin-sample/ios/Package.swift @@ -8,6 +8,7 @@ import PackageDescription let package = Package( name: "tauri-plugin-sample", platforms: [ + .macOS(.v10_13), .iOS(.v13), ], products: [ diff --git a/tooling/cli/templates/plugin/ios-spm/Package.swift b/tooling/cli/templates/plugin/ios-spm/Package.swift index ff9991fa9..faf3d3d6f 100644 --- a/tooling/cli/templates/plugin/ios-spm/Package.swift +++ b/tooling/cli/templates/plugin/ios-spm/Package.swift @@ -6,6 +6,7 @@ import PackageDescription let package = Package( name: "tauri-plugin-{{ plugin_name }}", platforms: [ + .macOS(.v10_13), .iOS(.v13), ], products: [