create stub resource files when actool output is missing

Older Xcode versions don't produce Assets.car from .icon assets.
Fall back to empty stubs for all platforms so the bundler succeeds.
This commit is contained in:
Jamie Pine
2026-03-17 01:07:54 -07:00
parent e601fd2ca4
commit ac68052945
+5 -5
View File
@@ -149,12 +149,12 @@ fn main() {
} }
} }
// On non-macOS, create empty stub files for the macOS-only resources // Ensure all resource files exist so Tauri's bundler doesn't fail.
// so Tauri's resource bundler doesn't fail on missing paths // On non-macOS these are always stubs. On macOS, actool may not produce
#[cfg(not(target_os = "macos"))] // Assets.car if the Xcode version doesn't support the .icon format.
{ {
let stubs = ["Assets.car", "voicebox.icns", "partial.plist"]; let required = ["Assets.car", "voicebox.icns", "partial.plist"];
for name in stubs { for name in required {
let path = format!("{}/{}", gen_dir, name); let path = format!("{}/{}", gen_dir, name);
if !std::path::Path::new(&path).exists() { if !std::path::Path::new(&path).exists() {
std::fs::write(&path, b"").ok(); std::fs::write(&path, b"").ok();