pub struct CodegenContext { /* private fields */ }
codegen
only.Expand description
A builder for generating a Tauri application context during compile time.
Implementations§
Source§impl CodegenContext
impl CodegenContext
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new CodegenContext
builder that is already filled with the default options.
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 package’s directory).
This defaults to a file called tauri.conf.json
inside of the current working directory of
the package compiling; does not need to be set manually if that config file is in the same
directory as your Cargo.toml
.
Sourcepub fn out_file(self, filename: PathBuf) -> Self
pub fn out_file(self, filename: PathBuf) -> Self
Sets the output file’s path.
Note: This path should be relative to the OUT_DIR
.
Don’t set this if you are using tauri::tauri_build_context!
as that helper macro
expects the default value. This option can be useful if you are not using the helper and
instead using std::include!
on the generated code yourself.
Defaults to tauri-build-context.rs
.
Sourcepub fn capability<P: AsRef<Path>>(self, path: P) -> Self
pub fn capability<P: AsRef<Path>>(self, path: P) -> Self
Adds a capability file to the generated context.