diff --git a/core/Cargo.toml b/core/Cargo.toml index f8b0444..1d4b53c 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bp3d-os" -version = "2.0.0" +version = "2.1.0" authors = ["Yuri Edward "] edition = "2021" description = "Operating System tools designed for BlockProject3D" diff --git a/core/src/module/loader/core.rs b/core/src/module/loader/core.rs index 455d30e..7e8c88f 100644 --- a/core/src/module/loader/core.rs +++ b/core/src/module/loader/core.rs @@ -329,6 +329,10 @@ impl ModuleLoader { self.paths.push(path.as_ref().into()); } + pub(super) fn _remove_search_path(&mut self, path: impl AsRef) { + self.paths.retain(|p| p != path.as_ref()); + } + pub(super) fn _add_public_dependency<'a>( &mut self, name: &str, diff --git a/core/src/module/loader/interface.rs b/core/src/module/loader/interface.rs index 20fcd34..dcab194 100644 --- a/core/src/module/loader/interface.rs +++ b/core/src/module/loader/interface.rs @@ -172,6 +172,17 @@ impl<'a> Lock<'a> { self.lock._add_search_path(path); } + /// Removes the given path to the path search list. + /// + /// # Arguments + /// + /// * `path`: the path to remove. + /// + /// returns: () + pub fn remove_search_path(&mut self, path: impl AsRef) { + self.lock._remove_search_path(path); + } + /// Adds a public facing API dependency to the list of dependency for version checks. /// /// This is used to check if there are any ABI incompatibilities between dependency versions diff --git a/module_test/test_mod/Cargo.toml b/module_test/test_mod/Cargo.toml index ed29b1c..22ad4bd 100644 --- a/module_test/test_mod/Cargo.toml +++ b/module_test/test_mod/Cargo.toml @@ -8,8 +8,8 @@ publish = false crate-type = ["rlib", "cdylib"] [build-dependencies] -bp3d-os-build = { version = "1.0.0", path = "../../build" } +bp3d-os-build = { version = "1.1.0", path = "../../build" } [dependencies] -bp3d-os = { version = "2.0.0", path = "../../core", features = ["module"] } +bp3d-os = { version = "2.1.0", path = "../../core", features = ["module"] } bp3d-debug = "1.0.0" diff --git a/module_test/testbin/Cargo.toml b/module_test/testbin/Cargo.toml index f81e2be..a27e040 100644 --- a/module_test/testbin/Cargo.toml +++ b/module_test/testbin/Cargo.toml @@ -5,4 +5,4 @@ edition = "2024" publish = false [dependencies] -bp3d-os = { version = "2.0.0", path = "../../core", features = ["module"] } +bp3d-os = { version = "2.1.0", path = "../../core", features = ["module"] }