Skip to content

Commit

Permalink
Don't use conandata
Browse files Browse the repository at this point in the history
Contribute to NP-186
  • Loading branch information
jellespijker committed May 10, 2024
1 parent 3d4dd19 commit 52cf75a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 0 additions & 8 deletions conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ requirements:
requirements_internal:
- "fdm_materials/(latest)@internal/testing"
- "cura_private_data/(latest)@internal/testing"
shared_resources:
- "definitions"
- "extruders"
- "images"
- "intent"
- "meshes"
- "quality"
- "variants"
urls:
default:
cloud_api_root: "https://api.ultimaker.com"
Expand Down
11 changes: 8 additions & 3 deletions resources/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class CuraResource(ConanFile):
settings = "os", "compiler", "build_type", "arch"
no_copy_source = True


@property
def _shared_resources(self):
return ["definitions", "extruders", "images", "intent", "meshes", "quality", "variants"]

def set_version(self):
if not self.version:
self.version = self.conan_data["version"]
Expand All @@ -30,7 +35,7 @@ def export(self):
update_conandata(self, {"version": self.version})

def export_sources(self):
for shared_resources in self.conan_data["shared_resources"]:
for shared_resources in self._shared_resources:
copy(self, pattern="*", src=os.path.join(self.recipe_folder, shared_resources),
dst=os.path.join(self.export_sources_folder, shared_resources))

Expand All @@ -39,8 +44,8 @@ def validate(self):
raise ConanInvalidConfiguration("Only versions 5+ are support")

def layout(self):
self.cpp.source.resdirs = self.conan_data["shared_resources"]
self.cpp.package.resdirs = [f"res/{res}" for res in self.conan_data["shared_resources"]]
self.cpp.source.resdirs = self._shared_resources
self.cpp.package.resdirs = [f"res/{res}" for res in self._shared_resources]

def package(self):
copy(self, "*", os.path.join(self.export_sources_folder),
Expand Down

0 comments on commit 52cf75a

Please sign in to comment.