Skip to content

Commit d8e4434

Browse files
(build-fix) Update dependencies and enhance macOS capabilities
- Added `tauri-plugin-http` and updated `tauri-plugin-updater` in Cargo.toml for improved functionality. - Modified the description in default.json to specify macOS capabilities and added the platforms key. - Refactored lib.rs to ensure macOS-specific permissions plugin is correctly integrated.
1 parent 0c8a7d6 commit d8e4434

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

src-tauri/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ tauri-build = { version = "2", features = [] }
2727
[dependencies]
2828
tauri = { version = "2", features = ["macos-private-api"] }
2929
tauri-plugin-opener = "2"
30-
tauri-plugin-updater = "2" # Move this here
30+
tauri-plugin-updater = "2"
31+
tauri-plugin-http = "2.5.2"
3132
serde = { version = "1", features = ["derive"] }
3233
serde_json = "1"
3334
image = "0.25.6"
34-
tauri-plugin-http = "2.5.2"
35+
xcap = "0.0.12"
36+
base64 = "0.22"
3537

3638
[target.'cfg(target_os = "macos")'.dependencies]
3739
tauri-plugin-macos-permissions = "2"
38-
xcap = "0.0.12"
39-
base64 = "0.22"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "../gen/schemas/desktop-schema.json",
3+
"identifier": "cross-platform",
4+
"description": "Capability for the main window on Windows and Linux",
5+
"windows": ["main"],
6+
"platforms": ["windows", "linux"],
7+
"permissions": [
8+
"core:default",
9+
"opener:default",
10+
"updater:default",
11+
{
12+
"identifier": "http:default",
13+
"allow": [{ "url": "http://**" }, { "url": "https://**" }]
14+
}
15+
]
16+
}

src-tauri/capabilities/default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"$schema": "../gen/schemas/desktop-schema.json",
33
"identifier": "default",
4-
"description": "Capability for the main window",
4+
"description": "Capability for the main window on macOS",
55
"windows": ["main"],
6+
"platforms": ["macOS"],
67
"permissions": [
78
"core:default",
89
"opener:default",

src-tauri/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
22
mod window;
3-
3+
#[cfg(target_os = "macos")]
4+
use tauri_plugin_macos_permissions;
45
use xcap::Monitor;
56
use base64::Engine;
67
use image::codecs::png::PngEncoder;
@@ -70,11 +71,11 @@ pub fn run() {
7071
Ok(())
7172
});
7273

73-
// Add macOS-specific permissions plugin
74-
#[cfg(target_os = "macos")]
75-
{
76-
builder = builder.plugin(tauri_plugin_macos_permissions::init());
77-
}
74+
// Add macOS-specific permissions plugin
75+
#[cfg(target_os = "macos")]
76+
{
77+
builder = builder.plugin(tauri_plugin_macos_permissions::init());
78+
}
7879

7980
builder
8081
.run(tauri::generate_context!())

0 commit comments

Comments
 (0)