feat: managing dependencies and building on different platforms

This commit is contained in:
2025-04-29 16:48:04 +01:00
parent 9b006836c6
commit d102ab3f6e
5 changed files with 52 additions and 701 deletions

File diff suppressed because it is too large Load Diff

View File

@ -24,22 +24,19 @@ serde_json = "1"
notify = "6.1.1" notify = "6.1.1"
base64 = "0.21.7" base64 = "0.21.7"
tokio = { version = "1.36.0", features = ["full"] } tokio = { version = "1.36.0", features = ["full"] }
tauri-plugin-http = "2.4.3"
chrono = "0.4" chrono = "0.4"
log = "0.4" log = "0.4"
tauri-plugin-http = "2.4.3"
tauri-plugin-log = "2" tauri-plugin-log = "2"
# tauri-plugin-sharetarget = "0.1.6"
tauri-plugin-fs = "2" tauri-plugin-fs = "2"
tauri-plugin-os = "2" tauri-plugin-os = "2"
tauri-plugin-store = "2"
[target."cfg(target_os = \"macos\")".dependencies] [target."cfg(target_os = \"macos\")".dependencies]
cocoa = "0.26" cocoa = "0.26"
tauri-plugin-store = "2.0.0-beta.12"
tauri-plugin-dialog = "2.2.1"
tauri-plugin-opener = "2.2.6"
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies] [target."cfg(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\"))".dependencies]
tauri-plugin-global-shortcut = "2.0.0-beta.12" tauri-plugin-global-shortcut = "2"
[target."cfg(target_os = \"android\")".dependencies] [target."cfg(target_os = \"android\")".dependencies]
tauri-plugin-sharetarget = "0.1.6" tauri-plugin-sharetarget = "0.1.6"

View File

@ -6,6 +6,8 @@ use std::path::PathBuf;
use std::sync::mpsc::channel; use std::sync::mpsc::channel;
use tauri::AppHandle; use tauri::AppHandle;
// TODO: we might be able to delete this soon.
#[tauri::command] #[tauri::command]
pub async fn handle_selected_folder( pub async fn handle_selected_folder(
path: String, path: String,

View File

@ -1,18 +1,24 @@
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod window; mod window;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod screenshot; mod screenshot;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod commands; mod commands;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod shortcut; mod shortcut;
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod state; mod state;
#[cfg(target_os = "linux")] #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod utils;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
use state::new_shared_watcher_state; use state::new_shared_watcher_state;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
use window::setup_window; use window::setup_window;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))] #[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
@ -40,7 +46,7 @@ pub fn desktop() {
// .invoke_handler(tauri::generate_handler![commands::handle_selected_folder,]) // .invoke_handler(tauri::generate_handler![commands::handle_selected_folder,])
.setup(|app| { .setup(|app| {
setup_window(app)?; setup_window(app)?;
shortcut::enable_shortcut(app); // shortcut::enable_shortcut(app);
Ok(()) Ok(())
}) })

View File

@ -15,7 +15,9 @@ pub fn setup_window(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
let window = win_builder let window = win_builder
.hidden_title(true) .hidden_title(true)
.title_bar_style(TitleBarStyle::Transparent).build().unwrap(); .title_bar_style(TitleBarStyle::Transparent)
.build()
.unwrap();
let ns_window = window.ns_window().unwrap() as id; let ns_window = window.ns_window().unwrap() as id;
unsafe { unsafe {
@ -30,5 +32,10 @@ pub fn setup_window(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
} }
} }
#[cfg(not(target_os = "macos"))]
{
let _ = win_builder.build().unwrap();
}
Ok(()) Ok(())
} }