From 89a613d25a635537fad5e76f35aa4683c95c4871 Mon Sep 17 00:00:00 2001 From: lights0123 Date: Sun, 31 Oct 2021 15:10:36 -0400 Subject: [PATCH] switch to tauri-build --- desktop/src-tauri/Cargo.lock | 16 +++++++++++++++- desktop/src-tauri/Cargo.toml | 4 ++-- desktop/src-tauri/src/build.rs | 15 +-------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index b6b567f..e7e92cf 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -1765,7 +1765,7 @@ dependencies = [ "serde", "serde_json", "tauri", - "winres", + "tauri-build", ] [[package]] @@ -3097,6 +3097,20 @@ dependencies = [ "zip", ] +[[package]] +name = "tauri-build" +version = "1.0.0-beta.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9c9a9bea25b9d6f5845b8662e18447e17218f99860cab37e39e2b57a9fcd49" +dependencies = [ + "anyhow", + "proc-macro2", + "quote 1.0.9", + "serde_json", + "tauri-utils", + "winres", +] + [[package]] name = "tauri-codegen" version = "1.0.0-beta.4" diff --git a/desktop/src-tauri/Cargo.toml b/desktop/src-tauri/Cargo.toml index 0f9f65e..304e63b 100644 --- a/desktop/src-tauri/Cargo.toml +++ b/desktop/src-tauri/Cargo.toml @@ -22,8 +22,8 @@ indicatif = "0.15" libusb1-sys = { version = "0.4.2", features = [ "vendored" ] } hashbrown = "0.11" -[target."cfg(windows)".build-dependencies] -winres = "0.1" +[build-dependencies] +tauri-build = { version = "1.0.0-beta.4" } [features] custom-protocol = [ "tauri/custom-protocol" ] diff --git a/desktop/src-tauri/src/build.rs b/desktop/src-tauri/src/build.rs index 83fb8f4..795b9b7 100644 --- a/desktop/src-tauri/src/build.rs +++ b/desktop/src-tauri/src/build.rs @@ -1,16 +1,3 @@ -#[cfg(windows)] -extern crate winres; - -#[cfg(windows)] fn main() { - if std::path::Path::new("icons/icon.ico").exists() { - let mut res = winres::WindowsResource::new(); - res.set_icon_with_id("icons/icon.ico", "32512"); - res.compile().expect("Unable to find visual studio tools"); - } else { - panic!("No Icon.ico found. Please add one or check the path"); - } + tauri_build::build() } - -#[cfg(not(windows))] -fn main() {}