Skip to content

Commit

Permalink
Merge pull request #50 from Ultimaker/CURA-11622_conan_v2
Browse files Browse the repository at this point in the history
Cura 11622 conan v2
  • Loading branch information
wawanbreton authored Dec 4, 2024
2 parents fcc178c + 24b645b commit 97df42a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 38 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,26 @@ on:
paths:
- 'cura/**'
- 'uranium/**'
- 'windows'
- 'windows/**'
- '.github/workflows/conan-package.yml'
- '.github/workflows/requirements-runner.txt'
- 'conanfile.py'
- 'conandata.yml'
branches:
- main
- master
- 'CURA-*'
- 'PP-*'
- 'NP-*'
- '[0-9].[0-9]*'
- '[0-9].[0-9][0-9]*'
tags:
- '[0-9]+.[0-9]+.[0-9]*'
- '[0-9]+.[0-9]+.[0-9]'

jobs:
conan-recipe-version:
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
conan-package:
uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@main
with:
project_name: cura_binary_data

conan-package-export:
needs: [ conan-recipe-version ]
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
platform_mac: false
install_system_dependencies: false
secrets: inherit

conan-package-create-windows:
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-linux:
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit
Empty file.
14 changes: 4 additions & 10 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from conan.tools.scm import Version
from conan.tools.files import copy, update_conandata

required_conan_version = ">=1.59.0"
required_conan_version = ">=2.7.0"


class CuraBinaryDataConan(ConanFile):
Expand All @@ -31,10 +31,6 @@ def export_sources(self):
copy(self, "*", os.path.join(self.recipe_folder, "uranium"), os.path.join(self.export_sources_folder, "uranium"))
copy(self, "*", os.path.join(self.recipe_folder, "windows"), os.path.join(self.export_sources_folder, "windows"))

def validate(self):
if (self.version != None) and (Version(self.version) <= Version("4")):
raise ConanInvalidConfiguration("Only versions 5+ are supported!")

def layout(self):
self.cpp.package.resdirs = [os.path.join("resources", "cura"), os.path.join("resources", "uranium"), "windows"]

Expand All @@ -51,10 +47,8 @@ def package_info(self):
self.runenv_info.append_path("PATH", os.path.join(self.cpp.package.resdirs[2], "arduino", "CP210x_6.7.4"))
self.runenv_info.append_path("PATH", os.path.join(self.cpp.package.resdirs[2], "arduino", "FTDI USB Drivers", "amd64"))

def package_id(self):
def compatibility(self):
del self.info.settings.compiler
del self.info.settings.build_type
if self.settings.os != "Windows":
compatible_pkg = self.info.clone()
compatible_pkg.settings.os = "Linux"
self.compatible_packages.append(compatible_pkg)
if self.info.settings.os != "Windows":
return [{"settings": [("os", "Linux")]}]
1 change: 1 addition & 0 deletions uranium/resources/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Place uranium specific resources here

0 comments on commit 97df42a

Please sign in to comment.