Update template app, maybe?
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled Details

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2024-04-03 14:40:36 +00:00
parent 1d1790c9d4
commit 878e6db2c8
4 changed files with 68 additions and 64 deletions

4
template/src-tauri/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/

View File

@ -1,3 +1,3 @@
fn main() { fn main() {
tauri_build::build() tauri_build::build()
} }

View File

@ -1,15 +1,15 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!! // Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command] #[tauri::command]
fn greet(name: &str) -> String { fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name) format!("Hello, {}! You've been greeted from Rust!", name)
} }
fn main() { fn main() {
tauri::Builder::default() tauri::Builder::default()
.invoke_handler(tauri::generate_handler![greet]) .invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }

View File

@ -1,46 +1,46 @@
{ {
"build": { "build": {
"beforeDevCommand": "", "beforeDevCommand": "",
"beforeBuildCommand": "", "beforeBuildCommand": "",
"devPath": "../src", "devPath": "../src",
"distDir": "../src", "distDir": "../src",
"withGlobalTauri": true "withGlobalTauri": true
}, },
"package": { "package": {
"productName": "{{ .Data.appName }}", "productName": "{{ .Data.appName }}",
"version": "{{ .Data.version }}" "version": "{{ .Data.version }}"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {
"all": false, "all": false,
"shell": { "shell": {
"all": false, "all": false,
"open": true "open": true
} }
}, },
"bundle": { "bundle": {
"active": true, "active": true,
"targets": "all", "targets": "all",
"identifier": "com.{{ .Data.shortName }}-tauri.dev", "identifier": "com.{{ .Data.shortName }}-tauri.dev",
"icon": [ "icon": [
"icons/32x32.png", "icons/32x32.png",
"icons/128x128.png", "icons/128x128.png",
"icons/128x128@2x.png", "icons/128x128@2x.png",
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
] ]
}, },
"security": { "security": {
"csp": null "csp": null
}, },
"windows": [ "windows": [
{ {
"fullscreen": false, "fullscreen": false,
"resizable": true, "resizable": true,
"title": "{{ .Data.appName }}", "title": "{{ .Data.appName }}",
"width": 800, "width": 800,
"height": 600 "height": 600
} }
] ]
} }
} }