pub struct Attributes { /* private fields */ }Expand description
The attributes used on the build.
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub fn windows_attributes(self, windows_attributes: WindowsAttributes) -> Self
pub fn windows_attributes(self, windows_attributes: WindowsAttributes) -> Self
Sets the WindowsAttributes, the Windows-specific options of the build script.
They are used to configure the application manifest, the application icon, additional
.rc content and the static linking of the Visual C++ runtime.
Setting them has no effect when compiling for other platforms.
§Examples
let attributes = tauri_build::Attributes::new().windows_attributes(
tauri_build::WindowsAttributes::new()
.window_icon_path("icons/icon.ico")
.static_vc_runtime(true),
);
tauri_build::try_build(attributes).expect("failed to run tauri-build");Sourcepub fn capabilities_path_pattern(self, pattern: &'static str) -> Self
pub fn capabilities_path_pattern(self, pattern: &'static str) -> Self
Set the glob pattern to be used to find the capabilities.
WARNING: The removeUnusedCommands option does not work with a custom capabilities path.
Note: You must emit rerun-if-changed instructions for your capabilities directory.
Sourcepub fn plugin(self, name: &'static str, plugin: InlinedPlugin) -> Self
pub fn plugin(self, name: &'static str, plugin: InlinedPlugin) -> Self
Adds the given plugin to the list of inlined plugins (a plugin that is part of your application).
See InlinedPlugin for more information.
Sourcepub fn plugins<I>(self, plugins: I) -> Self
pub fn plugins<I>(self, plugins: I) -> Self
Adds the given list of plugins to the list of inlined plugins (a plugin that is part of your application).
See InlinedPlugin for more information.
Sourcepub fn config_path(self, config_path: impl Into<PathBuf>) -> Self
pub fn config_path(self, config_path: impl Into<PathBuf>) -> Self
Set the path to the tauri.conf.json (relative to the crate’s directory).
This defaults to a file called tauri.conf.json inside of the current working directory of
the crate compiling; does not need to be set manually if that config file is in the same
directory as your Cargo.toml.
Sourcepub fn app_manifest(self, manifest: AppManifest) -> Self
pub fn app_manifest(self, manifest: AppManifest) -> Self
Sets the application manifest for the Access Control List.
See AppManifest for more information.
Sourcepub fn codegen(self, codegen: CodegenContext) -> Self
Available on crate feature codegen only.
pub fn codegen(self, codegen: CodegenContext) -> Self
codegen only.Generates the Tauri application context at build time instead of at macro expansion time.
The context is written to a file in the OUT_DIR that the
tauri::tauri_build_context! macro includes, so the application uses
tauri::Builder::run(tauri::tauri_build_context!()) instead of
tauri::Builder::run(tauri::generate_context!()).
This moves the asset embedding and the ACL resolution to the build script, which means the
cargo:rerun-if-changed instructions emitted for the frontend assets, icons and
configuration files are respected - with generate_context! the code is only regenerated
when the crate itself is recompiled.
See CodegenContext for the available options.
Requires the codegen Cargo feature.
§Examples
let attributes = tauri_build::Attributes::new().codegen(tauri_build::CodegenContext::new());
tauri_build::try_build(attributes).expect("failed to run tauri-build");