Expand description
§Dynamic Build Orchestrator
This binary serves as a powerful, configurable pre-build step for a Tauri
application. It is designed to be called from a shell script and dynamically
modifies project configuration files (Cargo.toml, tauri.conf.json) based
on environment variables and command-line arguments.
Its primary responsibilities include:
-
Generating a unique
productNameandidentifierfor different build “flavours” (e.g., for different dependencies, environments, or feature sets). -
Dynamically selecting a sidecar binary (like a specific Node.js version),
staging it in a temporary location, and configuring Tauri to bundle it.
-
Temporarily modifying configuration files, executing the final build command (e.g.,
pnpm tauri build), and then restoring the original files using aGuardpattern.
Structs§
- Argument
- Represents parsed command-line arguments and environment variables that control the build.
- Guard
- Manages the backup and restoration of a single file using the RAII pattern. Ensures that an original file is restored to its initial state when this struct goes out of scope.
- Manifest
- Represents the
packagesection of aCargo.tomlmanifest. - Meta
- Represents metadata within the
packagesection ofCargo.toml.
Enums§
- Error
- Represents all possible errors that can occur during the build script’s execution.
Constants§
- Backup
Suffix - Suffix used for backup files created by the
Guard. - Browser
Env - Environment variable for the “Browser” build flag.
- Bundle
Env - Environment variable for the “Bundle” build flag.
- Cargo
File - Cargo configuration filename.
- Clean
Env - Environment variable for the “Clean” build flag.
- Compile
Env - Environment variable for the “Compile” build flag.
- Dependency
Env - Environment variable for specifying a dependency flavour.
- DirEnv
- Environment variable for the project directory.
- Directory
Default - Default project directory relative to the workspace root.
- IdDelimiter
- Delimiter for parts of the generated bundle
identifier. - Json
File - Tauri JSON configuration filename.
- Jsonfive
File - Tauri JSON5 configuration filename.
- LogEnv
- Environment variable for setting the log level.
- Name
Default - Default project base name, used as a suffix for generated names.
- Name
Delimiter - Delimiter for parts of the generated
productName. - NameEnv
- Environment variable for the original base name of the project.
- NodeEnv
- Environment variable for the Node.js environment (
developmentorproduction). - Node
Version Env - Environment variable for selecting the Node.js sidecar version.
- Prefix
Default - Default bundle identifier prefix.
- Prefix
Env - Environment variable for the bundle identifier prefix.
Functions§
- Fn
- The main entry point of the binary.
- Json
Edit - Dynamically modifies fields in a
tauri.conf.jsonortauri.conf.json5file, including the sidecar path. - Logger
- Sets up the global logger for the application.
- Pascalize
- Converts a kebab-case or snake_case string to
PascalCase. - Process
- Main orchestration logic for preparing and executing the build.
- Toml
Edit - Dynamically modifies specific name fields within a
Cargo.tomlfile. This includespackage.name,package.default-run, andbin.name. - Verify
Env - Verifies if all required environment variables are set.