From ee23e2cf675cbfb2ebe27fd98bee562b0cebd7ed Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 11 Mar 2024 11:01:53 +0100 Subject: [PATCH] Add native CAD plugin to Enterprise edition The native CAD plugin has been added to the requirements and reference copy operations in the Conan data file and Conan file script. Now the native CAD plugin will only be included if the enterprise build flag is set. This ensures that unnecessary dependencies are not brought into non-enterprise builds. --- conandata.yml | 9 +++++++++ conanfile.py | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/conandata.yml b/conandata.yml index 0d0452ebbe..86e56e22c2 100644 --- a/conandata.yml +++ b/conandata.yml @@ -9,6 +9,7 @@ requirements: - "pysavitar/5.3.0" - "pynest2d/5.3.0" - "curaengine_grpc_definitions/0.2.0" + - "native_cad_plugin/2.0.0" requirements_internal: - "fdm_materials/(latest)@internal/testing" - "cura_private_data/(latest)@internal/testing" @@ -41,6 +42,14 @@ pyinstaller: package: "curaengine_plugin_gradual_flow" src: "res/bundled_packages" dst: "share/cura/resources/bundled_packages" + native_cad_plugin: + package: "native_cad_plugin" + src: "res/plugins/NativeCADplugin" + dst: "share/cura/plugins/NativeCADplugin" + native_cad_plugin_bundled: + package: "native_cad_plugin" + src: "res/bundled_packages" + dst: "share/cura/resources/bundled_packages" cura_resources: package: "cura" src: "resources" diff --git a/conanfile.py b/conanfile.py index ca6b4eabd0..2eebeee991 100644 --- a/conanfile.py +++ b/conanfile.py @@ -231,6 +231,8 @@ class CuraConan(ConanFile): else: src_path = os.path.join(self.source_folder, data["src"]) else: + if data["package"] not in self.deps_cpp_info.deps: + continue src_path = os.path.join(self.deps_cpp_info[data["package"]].rootpath, data["src"]) elif "root" in data: # get the paths relative from the install folder src_path = os.path.join(self.install_folder, data["root"], data["src"]) @@ -343,6 +345,8 @@ class CuraConan(ConanFile): for req in self.conan_data["requirements"]: if self._internal and "fdm_materials" in req: continue + if not self._enterprise and "native_cad_plugin" in req: + continue self.requires(req) if self._internal: for req in self.conan_data["requirements_internal"]: @@ -393,6 +397,12 @@ class CuraConan(ConanFile): copy(self, "*", curaengine_plugin_gradual_flow.bindirs[0], self.source_folder, keep_path = False) copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[1], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) + if self._enterprise: + rmdir(self, str(self.source_path.joinpath("plugins", "NativeCADplugin"))) + curaengine_plugin_gradual_flow = self.dependencies["native_cad_plugin"].cpp_info + copy(self, "*", curaengine_plugin_gradual_flow.resdirs[0], str(self.source_path.joinpath("plugins", "NativeCADplugin")), keep_path = True) + copy(self, "bundled_*.json", curaengine_plugin_gradual_flow.resdirs[1], str(self.source_path.joinpath("resources", "bundled_packages")), keep_path = False) + # Copy resources of cura_binary_data cura_binary_data = self.dependencies["cura_binary_data"].cpp_info copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True)