fn main() -> Result<(), Box> { if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") && std::env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") && std::env::var_os("CARGO_FEATURE_CLIPPY").is_some() { // Tauri's resource is linked to the app binary, but not to Rust unit-test harnesses. // Give mock-context builds their own manifest so tests can resolve TaskDialogIndirect. let out_dir = std::env::var_os("OUT_DIR").ok_or_else(|| std::io::Error::other("OUT_DIR is not set"))?; let manifest_path = std::path::PathBuf::from(out_dir).join("windows-test-manifest.xml"); std::fs::write( &manifest_path, r#" "#, )?; println!("cargo:rustc-link-arg=/MANIFEST:EMBED"); println!("cargo:rustc-link-arg=/MANIFESTINPUT:{}", manifest_path.display()); } #[cfg(feature = "clippy")] { println!("cargo:warning=Skipping tauri_build during Clippy"); } #[cfg(not(feature = "clippy"))] tauri_build::build(); Ok(()) }