Have developer/tester/etc. builds be distinct per biweekly day.

Less cause for confusion when sending out internal builds to test/develop on.

CURA-12469
This commit is contained in:
Remco Burema 2025-03-19 15:39:00 +01:00
parent 2bfb2fd6ad
commit a9018a06c4
2 changed files with 40 additions and 0 deletions

View File

@ -1,8 +1,10 @@
import json
import os import os
import requests import requests
import yaml import yaml
import tempfile import tempfile
import tarfile import tarfile
from datetime import datetime
from io import StringIO from io import StringIO
from pathlib import Path from pathlib import Path
from git import Repo from git import Repo
@ -562,6 +564,25 @@ class CuraConan(ConanFile):
self.cpp.package.bindirs = ["bin"] self.cpp.package.bindirs = ["bin"]
self.cpp.package.resdirs = ["resources", "plugins", "packaging"] self.cpp.package.resdirs = ["resources", "plugins", "packaging"]
def _make_internal_distinct(self):
test_colors_path = Path(self.source_folder, "resources", "themes", "daily_test_colors.json")
if self.options.internal:
biweekly_day = (datetime.now() - datetime(2025, 3, 14)).days
with test_colors_path.open("r") as test_colors_file:
test_colors = json.load(test_colors_file)
for theme_dir in Path(self.source_folder, "resources", "themes").iterdir():
if theme_dir.is_dir():
theme_path = Path(theme_dir, "theme.json")
if theme_path.exists():
with theme_path.open("r") as theme_file:
theme = json.load(theme_file)
if theme["colors"]:
theme["colors"]["main_window_header_background"] = test_colors[biweekly_day]
with theme_path.open("w") as theme_file:
json.dump(theme, theme_file)
elif test_colors_path.exists():
test_colors_path.unlink()
def generate(self): def generate(self):
copy(self, "cura_app.py", self.source_folder, str(self._script_dir)) copy(self, "cura_app.py", self.source_folder, str(self._script_dir))
@ -581,6 +602,9 @@ class CuraConan(ConanFile):
copy(self, "bundled_*.json", native_cad_plugin.resdirs[1], copy(self, "bundled_*.json", native_cad_plugin.resdirs[1],
str(Path(self.source_folder, "resources", "bundled_packages")), keep_path = False) str(Path(self.source_folder, "resources", "bundled_packages")), keep_path = False)
# Make internal versions built on different days distinct, so people don't get confused while testing.
self._make_internal_distinct()
# Copy resources of cura_binary_data # Copy resources of cura_binary_data
cura_binary_data = self.dependencies["cura_binary_data"].cpp_info cura_binary_data = self.dependencies["cura_binary_data"].cpp_info
copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True)

View File

@ -0,0 +1,16 @@
[
[ 62, 33, 55, 255],
[126, 196, 193, 255],
[126, 196, 193, 255],
[215, 155, 125, 255],
[228, 148, 58, 255],
[192, 199, 65, 255],
[157, 48, 59, 255],
[140, 143, 174, 255],
[ 23, 67, 75, 255],
[ 23, 67, 75, 255],
[154, 99, 72, 255],
[112, 55, 127, 255],
[100, 125, 52, 255],
[210, 100, 113, 255]
]