diff --git a/crates/tauri-build/src/lib.rs b/crates/tauri-build/src/lib.rs index 581be21ad..b67596c6a 100644 --- a/crates/tauri-build/src/lib.rs +++ b/crates/tauri-build/src/lib.rs @@ -419,23 +419,26 @@ pub fn is_dev() -> bool { /// Run all build time helpers for your Tauri Application. /// -/// The current helpers include the following: -/// * Generates a Windows Resource file when targeting Windows. +/// To provide extra configuration, such as [`AppManifest::commands`] +/// for fine-grained control over command permissions, see [`try_build`]. +/// See [`Attributes`] for the complete list of configuration options. /// /// # Platforms /// -/// [`build()`] should be called inside of `build.rs` regardless of the platform: -/// * New helpers may target more platforms in the future. -/// * Platform specific code is handled by the helpers automatically. -/// * A build script is required in order to activate some cargo environmental variables that are -/// used when generating code and embedding assets - so [`build()`] may as well be called. +/// [`build()`] should be called inside of `build.rs` regardless of the platform, so **DO NOT** use a [conditional compilation] +/// check that prevents it from running on any of your targets. /// -/// In short, this is saying don't put the call to [`build()`] behind a `#[cfg(windows)]`. +/// Platform specific code is handled by the helpers automatically. +/// +/// A build script is required in order to activate some cargo environmental variables that are +/// used when generating code and embedding assets. /// /// # Panics /// /// If any of the build time helpers fail, they will [`std::panic!`] with the related error message. /// This is typically desirable when running inside a build script; see [`try_build`] for no panics. +/// +/// [conditional compilation]: https://web.mit.edu/rust-lang_v1.25/arch/amd64_ubuntu1404/share/doc/rust/html/book/first-edition/conditional-compilation.html pub fn build() { if let Err(error) = try_build(Attributes::default()) { let error = format!("{error:#}"); @@ -450,7 +453,7 @@ pub fn build() { } } -/// Non-panicking [`build()`]. +/// Same as [`build()`], but takes an extra configuration argument, and does not panic. #[allow(unused_variables)] pub fn try_build(attributes: Attributes) -> Result<()> { use anyhow::anyhow;