pub struct PluginPackager { /* private fields */ }Expand description
A build-time tool that compiles, packages, and optionally signs a WinIsland plugin DLL into a distributable ZIP archive.
§Usage
use winisland_plugin_api::packager::PluginPackager;
PluginPackager::from_cargo()
.unwrap()
.signing_key_path("signing_key.pem")
.include_dir("assets")
.build()
.unwrap();Implementations§
Source§impl PluginPackager
impl PluginPackager
Sourcepub fn from_cargo() -> Result<Self, String>
pub fn from_cargo() -> Result<Self, String>
Create a packager by reading Cargo.toml from the current working directory.
Automatically fills in name, version, and author from the
[package] section. The DLL filename is derived from the crate name
(hyphens replaced with underscores).
Set the plugin author.
Sourcepub fn description(&mut self, v: &str) -> &mut Self
pub fn description(&mut self, v: &str) -> &mut Self
Set the plugin description.
Sourcepub fn github_link(&mut self, v: &str) -> &mut Self
pub fn github_link(&mut self, v: &str) -> &mut Self
Set the GitHub link for the plugin repository.
Sourcepub fn dll_name(&mut self, name: &str) -> &mut Self
pub fn dll_name(&mut self, name: &str) -> &mut Self
Override the DLL filename (without .dll extension).
By default the DLL name is derived from the crate name by replacing hyphens with underscores.
Sourcepub fn dll_path(&mut self, path: &str) -> &mut Self
pub fn dll_path(&mut self, path: &str) -> &mut Self
Override the built DLL path.
By default it looks for target/release/<dll_name>.dll.
Sourcepub fn include_dir(&mut self, dir: &str) -> &mut Self
pub fn include_dir(&mut self, dir: &str) -> &mut Self
Include an additional directory in the plugin ZIP.
The directory is relative to the plugin project root.
Can be called multiple times to include multiple directories.
Typical uses: assets, locales, fonts.
Sourcepub fn signing_key_path(&mut self, path: &str) -> &mut Self
pub fn signing_key_path(&mut self, path: &str) -> &mut Self
Sign the plugin with a key loaded from a PEM file.
Sourcepub fn signing_key_env(&mut self, var: &str) -> &mut Self
pub fn signing_key_env(&mut self, var: &str) -> &mut Self
Sign the plugin with a key loaded from an environment variable.
Sourcepub fn signing_key_bytes(&mut self, key_bytes: &[u8; 64]) -> &mut Self
pub fn signing_key_bytes(&mut self, key_bytes: &[u8; 64]) -> &mut Self
Sign the plugin with a key provided directly as bytes.
Sourcepub fn output(&mut self, path: &str) -> &mut Self
pub fn output(&mut self, path: &str) -> &mut Self
Set the output ZIP path.
Defaults to target/<name>-<version>.zip.
Sourcepub fn build(&self) -> Result<PathBuf, String>
pub fn build(&self) -> Result<PathBuf, String>
Execute the full build + package + sign pipeline.
- Runs
cargo build --release - Locates the built
.dll - Creates a staging directory with the DLL and extra dirs
- Generates
plugin.ymlwith DLL hashes - Signs the manifest if a signing key was provided
- Packs everything into a ZIP archive
Returns the path to the generated ZIP file.