chore: update change file, fix combined libs generation

This commit is contained in:
amrbashir
2025-05-25 10:24:07 +03:00
parent 58ac8913b9
commit 4475e76138
5 changed files with 18 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
---
"nsis-tauri-utils": "patch"
"nsis_tauri_utils": "patch"
---
Fix `StrReplace` not accessible in this plugin.

View File

@@ -1,11 +1,13 @@
#![no_std]
use nsis_plugin_api::*;
nsis_plugin!();
/* start-marker */
extern crate alloc;
use alloc::{borrow::ToOwned, vec, vec::Vec};
use core::{ffi::c_void, mem, ops::Deref, ops::DerefMut, ptr};
use nsis_plugin_api::*;
use windows_sys::Win32::Foundation::{ERROR_ACCESS_DENIED, ERROR_INVALID_PARAMETER};
use windows_sys::{
w,
@@ -36,8 +38,6 @@ use windows_sys::{
},
};
nsis_plugin!();
/// Test if there is a running process with the given name, skipping processes with the host's pid. The input and process names are case-insensitive.
///
/// # Safety
@@ -371,6 +371,8 @@ impl DerefMut for OwnedHandle {
}
}
/* end-marker */
#[cfg(test)]
mod tests {

View File

@@ -1,12 +1,11 @@
#![no_std]
use core::cmp::Ordering;
use nsis_plugin_api::*;
use semver::Version;
nsis_plugin!();
/* start-marker */
use core::cmp::Ordering;
use semver::Version;
/// Compare two semantic versions.
///
/// Returns `0` if equal, `1` if `$v1` is newer and `-1` if `$v2` is newer.
@@ -47,6 +46,8 @@ fn compare(v1: &str, v2: &str) -> i32 {
}
}
/* end-marker */
#[cfg(test)]
mod tests {
use super::*;

View File

@@ -1,9 +1,9 @@
#![no_std]
use nsis_plugin_api::*;
nsis_plugin!();
/* start-marker */
/// Replaces all occurrences of a substring in a string with another substring.
///
/// Returns the modified string.
@@ -22,3 +22,5 @@ fn StrReplace() -> Result<(), Error> {
Ok(())
}
/* end-marker */

View File

@@ -23,14 +23,8 @@ fn combine_plugins_and_write_to_out_dir() {
] {
let lines = plugin
.lines()
.filter(|l| {
// remove lines that should only be specified once
// either for compilation or for clippy
!(l.contains("#![no_std]")
|| l.contains("nsis_plugin!();")
|| l.contains("use nsis_plugin_api::*;"))
})
.take_while(|l| !l.contains("mod tests {"))
.skip_while(|&l| l != "/* start-marker */")
.take_while(|&l| l != "/* end-marker */")
.collect::<Vec<&str>>();
// skip last line which should be #[cfg(test)]