mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Add cura_resources as dependency and update resource directories
A new dependency 'cura_resources' has been added to the conandata.yml. The handling of 'cura_resources' has been updated, now including specific sections for definitions, extruders, intent, meshes, quality and variants. GitHub Actions workflows and conan scripts have been adjusted accordingly to include these changes. Contribute to NP-186
This commit is contained in:
parent
26c4354ac2
commit
0942c35c0a
5 changed files with 50 additions and 8 deletions
|
@ -6,12 +6,12 @@ on:
|
|||
- '.github/workflows/conan-package-resources.yml'
|
||||
- 'resources/definitions/**'
|
||||
- 'resources/extruders/**'
|
||||
- 'resources/images/**'
|
||||
- 'resources/intent/**'
|
||||
- 'resources/meshes/**'
|
||||
- 'resources/quality/**'
|
||||
- 'resources/variants/**'
|
||||
- 'resources/conanfile.py'
|
||||
- 'resources/conandata.yml'
|
||||
branches:
|
||||
- 'main'
|
||||
- 'CURA-*'
|
||||
|
|
9
.github/workflows/conan-package.yml
vendored
9
.github/workflows/conan-package.yml
vendored
|
@ -5,6 +5,15 @@ on:
|
|||
paths:
|
||||
- 'plugins/**'
|
||||
- 'cura/**'
|
||||
- 'resources/bundled_packages/**'
|
||||
- 'resources/i18n/**'
|
||||
- 'resources/qml/**'
|
||||
- 'resources/setting_visibility/**'
|
||||
- 'resources/shaders/**'
|
||||
- 'resources/texts/**'
|
||||
- 'resources/themes/**'
|
||||
- 'resources/public_key.pem'
|
||||
- 'resources/README_resources.txt'
|
||||
- 'icons/**'
|
||||
- 'tests/**'
|
||||
- 'packaging/**'
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
version: "5.8.0-alpha.0"
|
||||
requirements:
|
||||
- "cura_resources/(latest)@ultimaker/np_186"
|
||||
- "uranium/(latest)@ultimaker/testing"
|
||||
- "curaengine/(latest)@ultimaker/testing"
|
||||
- "cura_binary_data/(latest)@ultimaker/testing"
|
||||
|
@ -50,10 +51,30 @@ pyinstaller:
|
|||
package: "native_cad_plugin"
|
||||
src: "res/bundled_packages"
|
||||
dst: "share/cura/resources/bundled_packages"
|
||||
cura_resources:
|
||||
package: "cura"
|
||||
src: "resources"
|
||||
dst: "share/cura/resources"
|
||||
cura_resources_definitions:
|
||||
package: "cura_resources"
|
||||
src: "definitions"
|
||||
dst: "share/cura/resources/definitions"
|
||||
cura_resources_extruders:
|
||||
package: "cura_resources"
|
||||
src: "extruders"
|
||||
dst: "share/cura/resources/extruders"
|
||||
cura_resources_intent:
|
||||
package: "cura_resources"
|
||||
src: "intent"
|
||||
dst: "share/cura/resources/intent"
|
||||
cura_resources_meshes:
|
||||
package: "cura_resources"
|
||||
src: "meshes"
|
||||
dst: "share/cura/resources/meshes"
|
||||
cura_resources_quality:
|
||||
package: "cura_resources"
|
||||
src: "quality"
|
||||
dst: "share/cura/resources/quality"
|
||||
cura_resources_variants:
|
||||
package: "cura_resources"
|
||||
src: "variants"
|
||||
dst: "share/cura/resources/variants"
|
||||
cura_private_data:
|
||||
package: "cura_private_data"
|
||||
src: "res"
|
||||
|
|
12
conanfile.py
12
conanfile.py
|
@ -468,6 +468,12 @@ class CuraConan(ConanFile):
|
|||
copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[0]), str(self._share_dir.joinpath("cura", "resources")), keep_path = True)
|
||||
copy(self, "*", os.path.join(self.package_folder, self.cpp_info.resdirs[1]), str(self._share_dir.joinpath("cura", "plugins")), keep_path = True)
|
||||
|
||||
# Copy the cura_resources resources from the package
|
||||
rm(self, "conanfile.py", os.path.join(self.package_folder, self.cpp.package.resdirs[0]))
|
||||
cura_resources = self.dependencies["cura_resources"].cpp_info
|
||||
for res_dir in cura_resources.resdirs:
|
||||
copy(self, "*", res_dir, str(self._share_dir.joinpath("cura", "resources", res_dir)))
|
||||
|
||||
# Copy resources of Uranium (keep folder structure)
|
||||
uranium = self.dependencies["uranium"].cpp_info
|
||||
copy(self, "*", uranium.resdirs[0], str(self._share_dir.joinpath("uranium", "resources")), keep_path = True)
|
||||
|
@ -519,6 +525,12 @@ echo "CURA_APP_NAME={{ cura_app_name }}" >> ${{ env_prefix }}GITHUB_ENV
|
|||
# Remove the fdm_materials from the package
|
||||
rmdir(self, os.path.join(self.package_folder, self.cpp.package.resdirs[0], "materials"))
|
||||
|
||||
# Remove the cura_resources resources from the package
|
||||
rm(self, "conanfile.py", os.path.join(self.package_folder, self.cpp.package.resdirs[0]))
|
||||
cura_resources = self.dependencies["cura_resources"].cpp_info
|
||||
for res_dir in cura_resources.resdirs:
|
||||
rmdir(self, os.path.join(self.package_folder, self.cpp.package.resdirs[0], res_dir))
|
||||
|
||||
def package_info(self):
|
||||
self.user_info.pip_requirements = "requirements.txt"
|
||||
self.user_info.pip_requirements_git = "requirements-ultimaker.txt"
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import os
|
||||
from pathlib import Path
|
||||
from jinja2 import Template
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.files import copy, update_conandata
|
||||
|
@ -35,6 +33,8 @@ class CuraResource(ConanFile):
|
|||
dst=os.path.join(self.export_sources_folder, "definitions"))
|
||||
copy(self, pattern="*", src=os.path.join(self.recipe_folder, "extruders"),
|
||||
dst=os.path.join(self.export_sources_folder, "extruders"))
|
||||
copy(self, pattern="*", src=os.path.join(self.recipe_folder, "images"),
|
||||
dst=os.path.join(self.export_sources_folder, "images"))
|
||||
copy(self, pattern="*", src=os.path.join(self.recipe_folder, "intent"),
|
||||
dst=os.path.join(self.export_sources_folder, "intent"))
|
||||
copy(self, pattern="*", src=os.path.join(self.recipe_folder, "meshes"),
|
||||
|
@ -49,7 +49,7 @@ class CuraResource(ConanFile):
|
|||
raise ConanInvalidConfiguration("Only versions 5+ are support")
|
||||
|
||||
def layout(self):
|
||||
self.cpp.source.resdirs = ["definitions", "extruders", "intent", "meshes", "quality", "variants"]
|
||||
self.cpp.source.resdirs = ["definitions", "extruders", "images", "intent", "meshes", "quality", "variants"]
|
||||
|
||||
def package(self):
|
||||
copy(self, "*", os.path.join(self.export_sources_folder),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue