diff options
author | j.spijker@ultimaker.com <jelle spijker> | 2022-08-10 13:36:41 +0300 |
---|---|---|
committer | jspijker <j.spijker@ultimaker.com> | 2022-08-10 13:36:41 +0300 |
commit | e8c9df179431eb9d9afa1ad4be450d3b8ad98e2d (patch) | |
tree | 81cacaf71122e75d3381ef260452c8e33d9c9b72 | |
parent | c09eb17a247a22187926ba0564a35901e06530b8 (diff) |
Add internal build options
This will add the keyword `internal` to the build metadata such that
it is easier to distinguish between normal Cura builds and internal
builds with private data.
-rw-r--r-- | conanfile.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/conanfile.py b/conanfile.py index c59a22eef2..74106fd169 100644 --- a/conanfile.py +++ b/conanfile.py @@ -40,7 +40,8 @@ class CuraConan(ConanFile): "devtools": [True, False], # FIXME: Split this up in testing and (development / build (pyinstaller) / system installer) tools "cloud_api_version": "ANY", "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] } default_options = { "enterprise": "False", @@ -48,7 +49,8 @@ class CuraConan(ConanFile): "devtools": False, "cloud_api_version": "1", "display_name": "Ultimaker Cura", - "cura_debug_mode": False # Not yet implemented + "cura_debug_mode": False, # Not yet implemented + "internal": False, } scm = { "type": "git", @@ -157,11 +159,16 @@ class CuraConan(ConanFile): with open(Path(__file__).parent.joinpath("CuraVersion.py.jinja"), "r") as f: cura_version_py = Template(f.read()) + cura_version = self.version + if self.options.internal: + version = tools.Version(self.version) + cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.prerelease.replace('+', '+internal_')}" + with open(Path(location, "CuraVersion.py"), "w") as f: f.write(cura_version_py.render( cura_app_name = self.name, cura_app_display_name = self.options.display_name, - cura_version = self.version, + cura_version = cura_version, cura_build_type = "Enterprise" if self._enterprise else "", cura_debug_mode = self.options.cura_debug_mode, cura_cloud_api_root = self._cloud_api_root, |