| 1 | mod command_start_server; |
| 2 | mod google; |
| 3 | |
| 4 | use command_start_server::start_server; |
| 5 | use google::command_get_consent_url::get_consent_url; |
| 6 | use google::command_get_profile::get_profile; |
| 7 | use google::command_get_token::get_token; |
| 8 | use tauri_plugin_log::fern::colors::{Color, ColoredLevelConfig}; |
| 9 | |
| 10 | #[macro_use] |
| 11 | extern crate dotenv_codegen; |
| 12 | |
| 13 | #[cfg_attr(mobile, tauri::mobile_entry_point)] |
| 14 | pub fn run() { |
| 15 | tauri::Builder::default() |
| 16 | .plugin(tauri_plugin_store::Builder::new().build()) |
| 17 | .plugin( |
| 18 | tauri_plugin_log::Builder::new() |
| 19 | .with_colors( |
| 20 | ColoredLevelConfig::default() |
| 21 | .debug(Color::Green) |
| 22 | .info(Color::Cyan), |
| 23 | ) |
| 24 | .target(tauri_plugin_log::Target::new( |
| 25 | tauri_plugin_log::TargetKind::Stdout, |
| 26 | )) |
| 27 | .build(), |
| 28 | ) |
| 29 | .plugin(tauri_plugin_os::init()) |
| 30 | .plugin(tauri_plugin_opener::init()) |
| 31 | .plugin(tauri_plugin_haptics::init()) |
| 32 | .setup(|#[allow(unused)] app| { |
| 33 | // Android-only plugin. |
| 34 | #[cfg(target_os = "android")] |
| 35 | { |
| 36 | app.handle().plugin(tauri_plugin_admob::init())?; |
| 37 | } |
| 38 | app.handle().plugin(tauri_plugin_oauth::init())?; |
| 39 | Ok(()) |
| 40 | }) |
| 41 | .invoke_handler(tauri::generate_handler![ |
| 42 | start_server, |
| 43 | get_token, |
| 44 | get_profile, |
| 45 | get_consent_url, |
| 46 | ]) |
| 47 | .run(tauri::generate_context!()) |
| 48 | .expect("Error while running tauri application"); |
| 49 | } |