mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:58:59 +08:00
Applied work-around for GH true/false instead of True/False
Contributes to CURA-10831
This commit is contained in:
parent
9ad993f8ca
commit
b678951759
18
conanfile.py
18
conanfile.py
@ -34,7 +34,7 @@ class CuraConan(ConanFile):
|
|||||||
"cloud_api_version": "ANY",
|
"cloud_api_version": "ANY",
|
||||||
"display_name": "ANY", # TODO: should this be an option??
|
"display_name": "ANY", # TODO: should this be an option??
|
||||||
"cura_debug_mode": [True, False], # FIXME: Use profiles
|
"cura_debug_mode": [True, False], # FIXME: Use profiles
|
||||||
"internal": [True, False],
|
"internal": ["True", "False", "true", "false"], # Workaround for GH Action passing boolean as lowercase string
|
||||||
"enable_i18n": [True, False],
|
"enable_i18n": [True, False],
|
||||||
}
|
}
|
||||||
default_options = {
|
default_options = {
|
||||||
@ -44,7 +44,7 @@ class CuraConan(ConanFile):
|
|||||||
"cloud_api_version": "1",
|
"cloud_api_version": "1",
|
||||||
"display_name": "UltiMaker Cura",
|
"display_name": "UltiMaker Cura",
|
||||||
"cura_debug_mode": False, # Not yet implemented
|
"cura_debug_mode": False, # Not yet implemented
|
||||||
"internal": False,
|
"internal": "False",
|
||||||
"enable_i18n": False,
|
"enable_i18n": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,6 +84,10 @@ class CuraConan(ConanFile):
|
|||||||
def _enterprise(self):
|
def _enterprise(self):
|
||||||
return self.options.enterprise in ["True", 'true']
|
return self.options.enterprise in ["True", 'true']
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _internal(self):
|
||||||
|
return self.options.enterprise in ["True", 'true']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _app_name(self):
|
def _app_name(self):
|
||||||
if self._enterprise:
|
if self._enterprise:
|
||||||
@ -182,7 +186,7 @@ class CuraConan(ConanFile):
|
|||||||
cura_version = Version(self.conf.get("user.cura:version", default = self.version, check_type = str))
|
cura_version = Version(self.conf.get("user.cura:version", default = self.version, check_type = str))
|
||||||
pre_tag = f"-{cura_version.pre}" if cura_version.pre else ""
|
pre_tag = f"-{cura_version.pre}" if cura_version.pre else ""
|
||||||
build_tag = f"+{cura_version.build}" if cura_version.build else ""
|
build_tag = f"+{cura_version.build}" if cura_version.build else ""
|
||||||
internal_tag = f"+internal" if self.options.internal else ""
|
internal_tag = f"+internal" if self._internal else ""
|
||||||
cura_version = f"{cura_version.major}.{cura_version.minor}.{cura_version.patch}{pre_tag}{build_tag}{internal_tag}"
|
cura_version = f"{cura_version.major}.{cura_version.minor}.{cura_version.patch}{pre_tag}{build_tag}{internal_tag}"
|
||||||
|
|
||||||
with open(os.path.join(location, "CuraVersion.py"), "w") as f:
|
with open(os.path.join(location, "CuraVersion.py"), "w") as f:
|
||||||
@ -206,7 +210,7 @@ class CuraConan(ConanFile):
|
|||||||
pyinstaller_metadata = self.conan_data["pyinstaller"]
|
pyinstaller_metadata = self.conan_data["pyinstaller"]
|
||||||
datas = []
|
datas = []
|
||||||
for data in pyinstaller_metadata["datas"].values():
|
for data in pyinstaller_metadata["datas"].values():
|
||||||
if not self.options.internal and data.get("internal", False):
|
if not self._internal and data.get("internal", False):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "package" in data: # get the paths from conan package
|
if "package" in data: # get the paths from conan package
|
||||||
@ -319,10 +323,10 @@ class CuraConan(ConanFile):
|
|||||||
|
|
||||||
def requirements(self):
|
def requirements(self):
|
||||||
for req in self.conan_data["requirements"]:
|
for req in self.conan_data["requirements"]:
|
||||||
if self.options.internal and "fdm_materials" in req:
|
if self._internal and "fdm_materials" in req:
|
||||||
continue
|
continue
|
||||||
self.requires(req)
|
self.requires(req)
|
||||||
if self.options.internal:
|
if self._internal:
|
||||||
for req in self.conan_data["requirements_internal"]:
|
for req in self.conan_data["requirements_internal"]:
|
||||||
if "fdm_materials" in req:
|
if "fdm_materials" in req:
|
||||||
continue
|
continue
|
||||||
@ -392,7 +396,7 @@ class CuraConan(ConanFile):
|
|||||||
copy(self, "*", fdm_materials.resdirs[0], self.source_folder)
|
copy(self, "*", fdm_materials.resdirs[0], self.source_folder)
|
||||||
|
|
||||||
# Copy internal resources
|
# Copy internal resources
|
||||||
if self.options.internal:
|
if self._internal:
|
||||||
cura_private_data = self.dependencies["cura_private_data"].cpp_info
|
cura_private_data = self.dependencies["cura_private_data"].cpp_info
|
||||||
copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura")))
|
copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura")))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user