Skip to content

Commit

Permalink
Don't use Git because the state is dirty
Browse files Browse the repository at this point in the history
Contributes to CURA-10831
  • Loading branch information
jellespijker committed Nov 11, 2023
1 parent c62aa62 commit 3bbcb0a
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.scm import Git, Version
from conan.tools.files import load, update_conandata
from conan.tools.scm import Version
from conan.tools.files import copy, update_conandata

required_conan_version = ">=1.59.0"

Expand All @@ -24,15 +24,12 @@ def set_version(self):
self.version = self.conan_data["version"]

def export(self):
git = Git(self, self.recipe_folder)
scm_url, scm_commit = git.get_url_and_commit()
update_conandata(self, {"sources": {"commit": scm_commit, "url": scm_url}, "version": self.version})
update_conandata(self, {"version": self.version})

def source(self):
git = Git(self)
sources = self.conan_data["sources"]
git.clone(url = sources["url"], target = ".")
git.checkout(commit = sources["commit"])
def export_sources(self):
copy(self, "*", os.path.join(self.recipe_folder, "cura"), os.path.join(self.export_sources_folder, "cura"))
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")):
Expand All @@ -42,11 +39,11 @@ def layout(self):
self.cpp.package.resdirs = [os.path.join("resources", "cura"), os.path.join("resources", "uranium"), "windows"]

def package(self):
self.copy("*", src = "cura", dst = self.cpp.package.resdirs[0])
self.copy("*", src = "uranium", dst = self.cpp.package.resdirs[1])
copy(self, "*", src = os.path.join(self.export_sources_folder, "cura"), dst = self.cpp.package.resdirs[0])
copy(self, "*", src = os.path.join(self.export_sources_folder, "uranium"), dst = self.cpp.package.resdirs[1])

if self.settings.os == "Windows":
self.copy("*", src = "windows", dst = self.cpp.package.resdirs[2])
copy(self, "*", src = os.path.join(self.export_sources_folder, "windows"), dst = self.cpp.package.resdirs[2])

def package_info(self):
if self.settings.os == "Windows":
Expand Down

0 comments on commit 3bbcb0a

Please sign in to comment.