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"
base64 = "0.21.7"
tokio = { version = "1.36.0", features = ["full"] }
tauri-plugin-http = "2.4.3"
chrono = "0.4"
log = "0.4"
tauri-plugin-http = "2.4.3"
tauri-plugin-log = "2"
# tauri-plugin-sharetarget = "0.1.6"
tauri-plugin-fs = "2"
tauri-plugin-os = "2"
tauri-plugin-store = "2"
[target."cfg(target_os = \"macos\")".dependencies]
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]
tauri-plugin-global-shortcut = "2.0.0-beta.12"
[target."cfg(any(target_os = \"macos\", target_os = \"linux\", target_os = \"windows\"))".dependencies]
tauri-plugin-global-shortcut = "2"
[target."cfg(target_os = \"android\")".dependencies]
tauri-plugin-sharetarget = "0.1.6"

View File

@ -6,6 +6,8 @@ use std::path::PathBuf;
use std::sync::mpsc::channel;
use tauri::AppHandle;
// TODO: we might be able to delete this soon.
#[tauri::command]
pub async fn handle_selected_folder(
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;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod screenshot;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod commands;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod shortcut;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
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;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
use window::setup_window;
#[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,])
.setup(|app| {
setup_window(app)?;
shortcut::enable_shortcut(app);
// shortcut::enable_shortcut(app);
Ok(())
})

View File

@ -15,7 +15,9 @@ pub fn setup_window(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
let window = win_builder
.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;
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(())
}