diff --git a/.changes/fix-shell-build.md b/.changes/fix-shell-build.md new file mode 100644 index 000000000..4b765c3fd --- /dev/null +++ b/.changes/fix-shell-build.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Fix compilation issues without the shell API features. diff --git a/core/tauri/src/endpoints/shell.rs b/core/tauri/src/endpoints/shell.rs index 77026619b..3be8cb9f8 100644 --- a/core/tauri/src/endpoints/shell.rs +++ b/core/tauri/src/endpoints/shell.rs @@ -5,13 +5,9 @@ #![allow(unused_imports)] use super::InvokeContext; -use crate::{ - api::{ - ipc::CallbackFn, - process::{CommandEvent, TerminatedPayload}, - }, - Runtime, -}; +#[cfg(any(shell_execute, shell_sidecar))] +use crate::api::process::{CommandEvent, TerminatedPayload}; +use crate::{api::ipc::CallbackFn, Runtime}; #[cfg(shell_scope)] use crate::{Manager, Scopes}; use encoding_rs::Encoding; @@ -38,6 +34,7 @@ fn command_child_store() -> &'static ChildStore { &STORE } +#[cfg(any(shell_execute, shell_sidecar))] #[derive(Debug, Clone, Serialize)] #[serde(tag = "event", content = "payload")] #[non_exhaustive] @@ -52,6 +49,7 @@ enum JSCommandEvent { Terminated(TerminatedPayload), } +#[cfg(any(shell_execute, shell_sidecar))] fn get_event_buffer(line: Vec, encoding: EncodingWrapper) -> Result { match encoding { EncodingWrapper::Text(character_encoding) => match character_encoding { @@ -64,6 +62,7 @@ fn get_event_buffer(line: Vec, encoding: EncodingWrapper) -> Result Self { match event { @@ -87,6 +86,7 @@ pub enum Buffer { Raw(Vec), } +#[cfg(any(shell_execute, shell_sidecar))] #[derive(Debug, Copy, Clone)] pub enum EncodingWrapper { Raw,