Update Tauri from v1 to v2 (#496)
* Upgrade tauri to v2 * update action and disable menu * Add args to workflow step in test.yml * Rename environment variables for Tauri signing * Change mainBinaryName from 'Cinny' to 'cinny' * Update linux file names to use 'Cinny' instead of 'cinny' * Upgrade Tauri action to v0.6.1 and fix targets Updated Tauri action version and corrected target specification.
This commit is contained in:
33
src-tauri/src/lib.rs
Normal file
33
src-tauri/src/lib.rs
Normal file
@@ -0,0 +1,33 @@
|
||||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
// mod menu;
|
||||
|
||||
use tauri::{webview::WebviewWindowBuilder, WebviewUrl};
|
||||
|
||||
pub fn run() {
|
||||
let port: u16 = 44548;
|
||||
let context = tauri::generate_context!();
|
||||
let builder = tauri::Builder::default();
|
||||
|
||||
// #[cfg(target_os = "macos")]
|
||||
// {
|
||||
// builder = builder.menu(menu::menu());
|
||||
// }
|
||||
|
||||
builder
|
||||
.plugin(tauri_plugin_localhost::Builder::new(port).build())
|
||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
.setup(move |app| {
|
||||
let url = format!("http://localhost:{}", port).parse().unwrap();
|
||||
let window_url = WebviewUrl::External(url);
|
||||
WebviewWindowBuilder::new(app, "main".to_string(), window_url)
|
||||
.title("Cinny")
|
||||
.build()?;
|
||||
Ok(())
|
||||
})
|
||||
.run(context)
|
||||
.expect("error while building tauri application");
|
||||
}
|
||||
Reference in New Issue
Block a user