Jamie Pine 0717d8dd0a Refactor code for improved clarity and performance
- Updated argument passing in various commands to use a more concise syntax.
- Simplified iteration in the ConstantTimeEqNull implementation for better readability.
- Enhanced file path checks in EventFilters for temporary and system files.
- Added `#[must_use]` attribute to functions in FrameDecoder to indicate their importance.
- Replaced `or_insert_with` with `or_default` for cleaner code in phase summary generation.
2025-12-10 14:43:17 -08:00

61 lines
1.5 KiB
Rust

use std::process::Command;
fn main() {
// Compile .icon to Assets.car on macOS
#[cfg(target_os = "macos")]
{
let project_root = std::env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
let icon_source = format!("{}/../Spacedrive.icon", project_root);
let gen_dir = format!("{}/gen", project_root);
// Create gen directory
std::fs::create_dir_all(&gen_dir).expect("Failed to create gen directory");
// Check if .icon file exists
if std::path::Path::new(&icon_source).exists() {
println!("cargo:rerun-if-changed={}", icon_source);
// Run actool to compile .icon to Assets.car
let output = Command::new("xcrun")
.args([
"actool",
&icon_source,
"--compile",
&gen_dir,
"--output-format",
"human-readable-text",
"--notices",
"--warnings",
"--errors",
"--output-partial-info-plist",
&format!("{}/partial.plist", gen_dir),
"--app-icon",
"Spacedrive",
"--include-all-app-icons",
"--enable-on-demand-resources",
"NO",
"--development-region",
"en",
"--target-device",
"mac",
"--minimum-deployment-target",
"11.0",
"--platform",
"macosx",
])
.output()
.expect("Failed to execute actool");
if !output.status.success() {
eprintln!("actool failed: {}", String::from_utf8_lossy(&output.stderr));
} else {
println!("Successfully compiled Spacedrive.icon to Assets.car");
}
} else {
println!("cargo:warning=Spacedrive.icon not found at {}", icon_source);
}
}
tauri_build::build()
}