chore(platforms): seperating permissions and inits on different platforms
This commit is contained in:
@@ -8,13 +8,12 @@ mod window;
|
||||
use state::new_shared_watcher_state;
|
||||
use window::setup_window;
|
||||
|
||||
#[cfg_attr(mobile, tauri::mobile_entry_point)]
|
||||
pub fn run() {
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
|
||||
pub fn desktop() {
|
||||
let watcher_state = new_shared_watcher_state();
|
||||
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_log::Builder::new().build())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_sharetarget::init())
|
||||
@@ -38,3 +37,19 @@ pub fn run() {
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
||||
pub fn android() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_fs::init())
|
||||
.plugin(tauri_plugin_store::Builder::new().build())
|
||||
.plugin(tauri_plugin_http::init())
|
||||
.plugin(tauri_plugin_sharetarget::init())
|
||||
.setup(|app| {
|
||||
setup_window(app)?;
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running android tauri application");
|
||||
}
|
||||
|
||||
@@ -2,5 +2,9 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
haystack_lib::run()
|
||||
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
|
||||
haystack_lib::desktop();
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "android"))]
|
||||
haystack_lib::android();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user