ScriptCollection 3.5.48__py3-none-any.whl → 3.5.49__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ScriptCollection/GeneralUtilities.py +8 -2
- ScriptCollection/ScriptCollectionCore.py +45 -10
- ScriptCollection/TasksForCommonProjectStructure.py +58 -8
- {ScriptCollection-3.5.48.dist-info → ScriptCollection-3.5.49.dist-info}/METADATA +1 -1
- {ScriptCollection-3.5.48.dist-info → ScriptCollection-3.5.49.dist-info}/RECORD +8 -8
- {ScriptCollection-3.5.48.dist-info → ScriptCollection-3.5.49.dist-info}/WHEEL +0 -0
- {ScriptCollection-3.5.48.dist-info → ScriptCollection-3.5.49.dist-info}/entry_points.txt +0 -0
- {ScriptCollection-3.5.48.dist-info → ScriptCollection-3.5.49.dist-info}/top_level.txt +0 -0
|
@@ -890,11 +890,17 @@ class GeneralUtilities:
|
|
|
890
890
|
GeneralUtilities.write_message_to_stdout(f"Result: {result}")
|
|
891
891
|
return result
|
|
892
892
|
|
|
893
|
+
@staticmethod
|
|
894
|
+
@check_arguments
|
|
895
|
+
def is_git_repository(folder: str) -> bool:
|
|
896
|
+
combined = os.path.join(folder, ".git")
|
|
897
|
+
# TODO consider check for bare-repositories
|
|
898
|
+
return os.path.isdir(combined) or os.path.isfile(combined)
|
|
899
|
+
|
|
893
900
|
@staticmethod
|
|
894
901
|
@check_arguments
|
|
895
902
|
def assert_is_git_repository(folder: str) -> str:
|
|
896
|
-
|
|
897
|
-
GeneralUtilities.assert_condition(os.path.isdir(git_file_or_folder) or os.path.isfile(git_file_or_folder), f"'{folder}' is not a git-repository.")
|
|
903
|
+
GeneralUtilities.assert_condition(GeneralUtilities.is_git_repository(folder), f"'{folder}' is not a git-repository.")
|
|
898
904
|
|
|
899
905
|
@staticmethod
|
|
900
906
|
@check_arguments
|
|
@@ -31,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
31
31
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
32
32
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
|
33
33
|
|
|
34
|
-
version = "3.5.
|
|
34
|
+
version = "3.5.49"
|
|
35
35
|
__version__ = version
|
|
36
36
|
|
|
37
37
|
|
|
@@ -460,7 +460,7 @@ class ScriptCollectionCore:
|
|
|
460
460
|
def git_fetch_or_clone_all_in_directory(self, source_directory: str, target_directory: str) -> None:
|
|
461
461
|
for subfolder in GeneralUtilities.get_direct_folders_of_folder(source_directory):
|
|
462
462
|
foldername = os.path.basename(subfolder)
|
|
463
|
-
if
|
|
463
|
+
if GeneralUtilities.is_git_repository(subfolder):
|
|
464
464
|
source_repository = subfolder
|
|
465
465
|
target_repository = os.path.join(target_directory, foldername)
|
|
466
466
|
if os.path.isdir(target_directory):
|
|
@@ -477,12 +477,6 @@ class ScriptCollectionCore:
|
|
|
477
477
|
result.append(submodule_line.split(' ')[1])
|
|
478
478
|
return result
|
|
479
479
|
|
|
480
|
-
@GeneralUtilities.check_arguments
|
|
481
|
-
def is_git_repository(self, folder: str) -> bool:
|
|
482
|
-
combined = os.path.join(folder, ".git")
|
|
483
|
-
# TODO consider check for bare-repositories
|
|
484
|
-
return os.path.isdir(combined) or os.path.isfile(combined)
|
|
485
|
-
|
|
486
480
|
@GeneralUtilities.check_arguments
|
|
487
481
|
def file_is_git_ignored(self, file_in_repository: str, repositorybasefolder: str) -> None:
|
|
488
482
|
exit_code = self.run_program_argsasarray("git", ['check-ignore', file_in_repository], repositorybasefolder, throw_exception_if_exitcode_is_not_zero=False, verbosity=0)[0]
|
|
@@ -1414,10 +1408,17 @@ class ScriptCollectionCore:
|
|
|
1414
1408
|
|
|
1415
1409
|
@GeneralUtilities.check_arguments
|
|
1416
1410
|
def __adapt_workingdirectory(self, workingdirectory: str) -> str:
|
|
1411
|
+
result: str = None
|
|
1417
1412
|
if workingdirectory is None:
|
|
1418
|
-
|
|
1413
|
+
result = os.getcwd()
|
|
1419
1414
|
else:
|
|
1420
|
-
|
|
1415
|
+
if os.path.isabs(workingdirectory):
|
|
1416
|
+
result = workingdirectory
|
|
1417
|
+
else:
|
|
1418
|
+
result = GeneralUtilities.resolve_relative_path_from_current_working_directory(workingdirectory)
|
|
1419
|
+
if not os.path.isdir(result):
|
|
1420
|
+
raise ValueError(f"Working-directory '{workingdirectory}' does not exist.")
|
|
1421
|
+
return result
|
|
1421
1422
|
|
|
1422
1423
|
@GeneralUtilities.check_arguments
|
|
1423
1424
|
def verify_no_pending_mock_program_calls(self):
|
|
@@ -1945,3 +1946,37 @@ TXDX
|
|
|
1945
1946
|
return True
|
|
1946
1947
|
else:
|
|
1947
1948
|
return False
|
|
1949
|
+
|
|
1950
|
+
@GeneralUtilities.check_arguments
|
|
1951
|
+
def ensure_local_docker_network_exists(self, network_name: str) -> None:
|
|
1952
|
+
if not self.local_docker_network_exists(network_name):
|
|
1953
|
+
self.create_local_docker_network(network_name)
|
|
1954
|
+
|
|
1955
|
+
@GeneralUtilities.check_arguments
|
|
1956
|
+
def ensure_local_docker_network_does_not_exist(self, network_name: str) -> None:
|
|
1957
|
+
if self.local_docker_network_exists(network_name):
|
|
1958
|
+
self.remove_local_docker_network(network_name)
|
|
1959
|
+
|
|
1960
|
+
@GeneralUtilities.check_arguments
|
|
1961
|
+
def local_docker_network_exists(self, network_name: str) -> bool:
|
|
1962
|
+
return network_name in self.get_all_local_existing_docker_networks()
|
|
1963
|
+
|
|
1964
|
+
@GeneralUtilities.check_arguments
|
|
1965
|
+
def get_all_local_existing_docker_networks(self) -> list[str]:
|
|
1966
|
+
program_call_result = self.run_program("docker", "network list")
|
|
1967
|
+
std_out = program_call_result[1]
|
|
1968
|
+
std_out_lines = std_out.split("\n")[1:]
|
|
1969
|
+
result: list[str] = []
|
|
1970
|
+
for std_out_line in std_out_lines:
|
|
1971
|
+
normalized_line = ';'.join(std_out_line.split())
|
|
1972
|
+
splitted = normalized_line.split(";")
|
|
1973
|
+
result.append(splitted[1])
|
|
1974
|
+
return result
|
|
1975
|
+
|
|
1976
|
+
@GeneralUtilities.check_arguments
|
|
1977
|
+
def remove_local_docker_network(self, network_name: str) -> None:
|
|
1978
|
+
self.run_program("docker", f"network remove {network_name}")
|
|
1979
|
+
|
|
1980
|
+
@GeneralUtilities.check_arguments
|
|
1981
|
+
def create_local_docker_network(self, network_name: str) -> None:
|
|
1982
|
+
self.run_program("docker", f"network create {network_name}")
|
|
@@ -113,6 +113,17 @@ class TasksForCommonProjectStructure:
|
|
|
113
113
|
validate_developers_of_repository: bool = True
|
|
114
114
|
dotnet_runsettings_file = "runsettings.xml"
|
|
115
115
|
|
|
116
|
+
@staticmethod
|
|
117
|
+
@GeneralUtilities.check_arguments
|
|
118
|
+
def assert_is_codeunit_folder(codeunit_folder: str) -> str:
|
|
119
|
+
repo_folder = GeneralUtilities.resolve_relative_path("..", codeunit_folder)
|
|
120
|
+
if not GeneralUtilities.is_git_repository(repo_folder):
|
|
121
|
+
raise ValueError(f"'{codeunit_folder}' can not be a valid codeunit-folder because '{repo_folder}' is not a git-repository.")
|
|
122
|
+
codeunit_name = os.path.basename(codeunit_folder)
|
|
123
|
+
codeunit_file: str = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
|
|
124
|
+
if not os.path.isfile(codeunit_file):
|
|
125
|
+
raise ValueError(f"'{codeunit_folder}' is no codeunit-folder because '{codeunit_file}' does not exist.")
|
|
126
|
+
|
|
116
127
|
@staticmethod
|
|
117
128
|
@GeneralUtilities.check_arguments
|
|
118
129
|
def get_development_environment_name() -> str:
|
|
@@ -297,6 +308,7 @@ class TasksForCommonProjectStructure:
|
|
|
297
308
|
|
|
298
309
|
@GeneralUtilities.check_arguments
|
|
299
310
|
def generate_bom_for_python_project(self, verbosity: int, codeunit_folder: str, codeunitname: str, commandline_arguments: list[str]) -> None:
|
|
311
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
300
312
|
verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
|
|
301
313
|
codeunitversion = self.get_version_of_codeunit_folder(codeunit_folder)
|
|
302
314
|
bom_folder = "Other/Artifacts/BOM"
|
|
@@ -352,6 +364,7 @@ class TasksForCommonProjectStructure:
|
|
|
352
364
|
|
|
353
365
|
@GeneralUtilities.check_arguments
|
|
354
366
|
def get_version_of_codeunit_folder(self, codeunit_folder: str) -> None:
|
|
367
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
355
368
|
codeunit_file = os.path.join(codeunit_folder, f"{os.path.basename(codeunit_folder)}.codeunit.xml")
|
|
356
369
|
return self.get_version_of_codeunit(codeunit_file)
|
|
357
370
|
|
|
@@ -473,6 +486,7 @@ class TasksForCommonProjectStructure:
|
|
|
473
486
|
GeneralUtilities.ensure_directory_does_not_exist(obj_folder)
|
|
474
487
|
|
|
475
488
|
def standardized_task_verify_standard_format_csproj_files(self, codeunit_folder: str) -> bool:
|
|
489
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
476
490
|
repository_folder = os.path.dirname(codeunit_folder)
|
|
477
491
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
478
492
|
codeunit_folder = os.path.join(repository_folder, codeunit_name)
|
|
@@ -492,6 +506,7 @@ class TasksForCommonProjectStructure:
|
|
|
492
506
|
raise ValueError(test_csproj_file+message+f'"{result2[1]}".')
|
|
493
507
|
|
|
494
508
|
def __standardized_task_verify_standard_format_for_project_csproj_file(self, csproj_file: str, codeunit_folder: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str]:
|
|
509
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
495
510
|
codeunit_name_regex = re.escape(codeunit_name)
|
|
496
511
|
codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
|
|
497
512
|
codeunit_description = self.get_codeunit_description(codeunit_file)
|
|
@@ -737,6 +752,7 @@ class TasksForCommonProjectStructure:
|
|
|
737
752
|
@GeneralUtilities.check_arguments
|
|
738
753
|
def generate_sbom_for_dotnet_project(self, codeunit_folder: str, verbosity: int, commandline_arguments: list[str]) -> None:
|
|
739
754
|
GeneralUtilities.write_message_to_stdout("Generate SBOM...")
|
|
755
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
740
756
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
741
757
|
sc = ScriptCollectionCore()
|
|
742
758
|
bomfile_folder = "Other\\Artifacts\\BOM"
|
|
@@ -872,6 +888,7 @@ class TasksForCommonProjectStructure:
|
|
|
872
888
|
|
|
873
889
|
@GeneralUtilities.check_arguments
|
|
874
890
|
def __standardized_tasks_run_testcases_for_dotnet_project_helper(self, source: str, codeunit_folder: str, match: re.Match) -> str:
|
|
891
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
875
892
|
filename = match.group(1)
|
|
876
893
|
file = os.path.join(source, filename)
|
|
877
894
|
# GeneralUtilities.assert_condition(os.path.isfile(file),f"File \"{file}\" does not exist.")
|
|
@@ -1152,6 +1169,7 @@ class TasksForCommonProjectStructure:
|
|
|
1152
1169
|
|
|
1153
1170
|
@GeneralUtilities.check_arguments
|
|
1154
1171
|
def generate_certificate_for_development_purposes_for_codeunit(self, codeunit_folder: str, domain: str = None):
|
|
1172
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1155
1173
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
1156
1174
|
self.ensure_product_resource_is_imported(codeunit_folder, "CA")
|
|
1157
1175
|
ca_folder: str = os.path.join(codeunit_folder, "Other", "Resources", "CA")
|
|
@@ -1656,6 +1674,7 @@ class TasksForCommonProjectStructure:
|
|
|
1656
1674
|
|
|
1657
1675
|
@GeneralUtilities.check_arguments
|
|
1658
1676
|
def replace_common_variables_in_nuspec_file(self, codeunit_folder: str) -> None:
|
|
1677
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1659
1678
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
1660
1679
|
codeunit_version = self.get_version_of_codeunit_folder(codeunit_folder)
|
|
1661
1680
|
nuspec_file = os.path.join(codeunit_folder, "Other", "Build", f"{codeunit_name}.nuspec")
|
|
@@ -1679,6 +1698,7 @@ class TasksForCommonProjectStructure:
|
|
|
1679
1698
|
|
|
1680
1699
|
@GeneralUtilities.check_arguments
|
|
1681
1700
|
def standardized_tasks_build_bom_for_node_project(self, codeunit_folder: str, verbosity: int, commandline_arguments: list[str]) -> None:
|
|
1701
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1682
1702
|
verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
|
|
1683
1703
|
# TODO
|
|
1684
1704
|
|
|
@@ -1806,47 +1826,57 @@ class TasksForCommonProjectStructure:
|
|
|
1806
1826
|
|
|
1807
1827
|
@GeneralUtilities.check_arguments
|
|
1808
1828
|
def set_default_constants(self, codeunit_folder: str) -> None:
|
|
1829
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1809
1830
|
self.set_constant_for_commitid(codeunit_folder)
|
|
1810
1831
|
self.set_constant_for_commitdate(codeunit_folder)
|
|
1811
|
-
self.
|
|
1832
|
+
self.set_constant_for_codeunitname(codeunit_folder)
|
|
1812
1833
|
self.set_constant_for_codeunitversion(codeunit_folder)
|
|
1813
1834
|
self.set_constant_for_codeunitmajorversion(codeunit_folder)
|
|
1814
1835
|
self.set_constant_for_description(codeunit_folder)
|
|
1815
1836
|
|
|
1816
1837
|
@GeneralUtilities.check_arguments
|
|
1817
1838
|
def set_constant_for_commitid(self, codeunit_folder: str) -> None:
|
|
1818
|
-
|
|
1839
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1840
|
+
repository = GeneralUtilities.resolve_relative_path("..", codeunit_folder)
|
|
1841
|
+
commit_id = self.__sc.git_get_commit_id(repository)
|
|
1819
1842
|
self.set_constant(codeunit_folder, "CommitId", commit_id)
|
|
1820
1843
|
|
|
1821
1844
|
@GeneralUtilities.check_arguments
|
|
1822
1845
|
def set_constant_for_commitdate(self, codeunit_folder: str) -> None:
|
|
1823
|
-
|
|
1846
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1847
|
+
repository = GeneralUtilities.resolve_relative_path("..", codeunit_folder)
|
|
1848
|
+
commit_date: datetime = self.__sc.git_get_commit_date(repository)
|
|
1824
1849
|
self.set_constant(codeunit_folder, "CommitDate", GeneralUtilities.datetime_to_string(commit_date))
|
|
1825
1850
|
|
|
1826
1851
|
@GeneralUtilities.check_arguments
|
|
1827
|
-
def
|
|
1852
|
+
def set_constant_for_codeunitname(self, codeunit_folder: str) -> None:
|
|
1853
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1828
1854
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
1829
1855
|
self.set_constant(codeunit_folder, "CodeUnitName", codeunit_name)
|
|
1830
1856
|
|
|
1831
1857
|
@GeneralUtilities.check_arguments
|
|
1832
1858
|
def set_constant_for_codeunitversion(self, codeunit_folder: str) -> None:
|
|
1859
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1833
1860
|
codeunit_version: str = self.get_version_of_codeunit_folder(codeunit_folder)
|
|
1834
1861
|
self.set_constant(codeunit_folder, "CodeUnitVersion", codeunit_version)
|
|
1835
1862
|
|
|
1836
1863
|
@GeneralUtilities.check_arguments
|
|
1837
1864
|
def set_constant_for_codeunitmajorversion(self, codeunit_folder: str) -> None:
|
|
1865
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1838
1866
|
codeunit_version: str = self.get_version_of_codeunit_folder(codeunit_folder)
|
|
1839
1867
|
major_version = int(codeunit_version.split(".")[0])
|
|
1840
1868
|
self.set_constant(codeunit_folder, "CodeUnitMajorVersion", str(major_version))
|
|
1841
1869
|
|
|
1842
1870
|
@GeneralUtilities.check_arguments
|
|
1843
1871
|
def set_constant_for_description(self, codeunit_folder: str) -> None:
|
|
1872
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1844
1873
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
1845
1874
|
codeunit_description: str = self.get_codeunit_description(f"{codeunit_folder}/{codeunit_name}.codeunit.xml")
|
|
1846
1875
|
self.set_constant(codeunit_folder, "CodeUnitDescription", codeunit_description)
|
|
1847
1876
|
|
|
1848
1877
|
@GeneralUtilities.check_arguments
|
|
1849
1878
|
def set_constant(self, codeunit_folder: str, constantname: str, constant_value: str, documentationsummary: str = None, constants_valuefile: str = None) -> None:
|
|
1879
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1850
1880
|
if documentationsummary is None:
|
|
1851
1881
|
documentationsummary = ""
|
|
1852
1882
|
constants_folder = os.path.join(codeunit_folder, "Other", "Resources", "Constants")
|
|
@@ -1874,16 +1904,19 @@ class TasksForCommonProjectStructure:
|
|
|
1874
1904
|
|
|
1875
1905
|
@GeneralUtilities.check_arguments
|
|
1876
1906
|
def get_constant_value(self, source_codeunit_folder: str, constant_name: str) -> str:
|
|
1907
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(source_codeunit_folder)
|
|
1877
1908
|
value_file_relative = self.__get_constant_helper(source_codeunit_folder, constant_name, "path")
|
|
1878
1909
|
value_file = GeneralUtilities.resolve_relative_path(value_file_relative, os.path.join(source_codeunit_folder, "Other", "Resources", "Constants"))
|
|
1879
1910
|
return GeneralUtilities.read_text_from_file(value_file)
|
|
1880
1911
|
|
|
1881
1912
|
@GeneralUtilities.check_arguments
|
|
1882
1913
|
def get_constant_documentation(self, source_codeunit_folder: str, constant_name: str) -> str:
|
|
1914
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(source_codeunit_folder)
|
|
1883
1915
|
return self.__get_constant_helper(source_codeunit_folder, constant_name, "documentationsummary")
|
|
1884
1916
|
|
|
1885
1917
|
@GeneralUtilities.check_arguments
|
|
1886
1918
|
def __get_constant_helper(self, source_codeunit_folder: str, constant_name: str, propertyname: str) -> str:
|
|
1919
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(source_codeunit_folder)
|
|
1887
1920
|
root: etree._ElementTree = etree.parse(os.path.join(source_codeunit_folder, "Other", "Resources", "Constants", f"{constant_name}.constant.xml"))
|
|
1888
1921
|
results = root.xpath(f'//cps:{propertyname}/text()', namespaces={
|
|
1889
1922
|
'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure'
|
|
@@ -1898,6 +1931,7 @@ class TasksForCommonProjectStructure:
|
|
|
1898
1931
|
|
|
1899
1932
|
@GeneralUtilities.check_arguments
|
|
1900
1933
|
def copy_development_certificate_to_default_development_directory(self, codeunit_folder: str, build_environment: str, domain: str = None, certificate_resource_name: str = "DevelopmentCertificate") -> None:
|
|
1934
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1901
1935
|
if build_environment != "Productive":
|
|
1902
1936
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
1903
1937
|
if domain is None:
|
|
@@ -1918,7 +1952,7 @@ class TasksForCommonProjectStructure:
|
|
|
1918
1952
|
@GeneralUtilities.check_arguments
|
|
1919
1953
|
def set_constants_for_certificate_public_information(self, codeunit_folder: str, source_constant_name: str = "DevelopmentCertificate", domain: str = None) -> None:
|
|
1920
1954
|
"""Expects a certificate-resource and generates a constant for its public information"""
|
|
1921
|
-
|
|
1955
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1922
1956
|
certificate_file = os.path.join(codeunit_folder, "Other", "Resources", source_constant_name, f"{source_constant_name}.crt")
|
|
1923
1957
|
with open(certificate_file, encoding="utf-8") as text_wrapper:
|
|
1924
1958
|
certificate = crypto.load_certificate(crypto.FILETYPE_PEM, text_wrapper.read())
|
|
@@ -1928,6 +1962,7 @@ class TasksForCommonProjectStructure:
|
|
|
1928
1962
|
@GeneralUtilities.check_arguments
|
|
1929
1963
|
def set_constants_for_certificate_private_information(self, codeunit_folder: str) -> None:
|
|
1930
1964
|
"""Expects a certificate-resource and generates a constant for its sensitive information in hex-format"""
|
|
1965
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1931
1966
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
1932
1967
|
resource_name: str = "DevelopmentCertificate"
|
|
1933
1968
|
filename: str = codeunit_name+"DevelopmentCertificate"
|
|
@@ -1936,6 +1971,7 @@ class TasksForCommonProjectStructure:
|
|
|
1936
1971
|
|
|
1937
1972
|
@GeneralUtilities.check_arguments
|
|
1938
1973
|
def generate_constant_from_resource_by_filename(self, codeunit_folder: str, resource_name: str, filename: str, constant_name: str) -> None:
|
|
1974
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1939
1975
|
certificate_resource_folder = GeneralUtilities.resolve_relative_path(f"Other/Resources/{resource_name}", codeunit_folder)
|
|
1940
1976
|
resource_file = os.path.join(certificate_resource_folder, filename)
|
|
1941
1977
|
resource_file_content = GeneralUtilities.read_binary_from_file(resource_file)
|
|
@@ -1944,6 +1980,7 @@ class TasksForCommonProjectStructure:
|
|
|
1944
1980
|
|
|
1945
1981
|
@GeneralUtilities.check_arguments
|
|
1946
1982
|
def generate_constant_from_resource_by_extension(self, codeunit_folder: str, resource_name: str, extension: str, constant_name: str) -> None:
|
|
1983
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1947
1984
|
certificate_resource_folder = GeneralUtilities.resolve_relative_path(f"Other/Resources/{resource_name}", codeunit_folder)
|
|
1948
1985
|
resource_file = self.__sc.find_file_by_extension(certificate_resource_folder, extension)
|
|
1949
1986
|
resource_file_content = GeneralUtilities.read_binary_from_file(resource_file)
|
|
@@ -1952,6 +1989,7 @@ class TasksForCommonProjectStructure:
|
|
|
1952
1989
|
|
|
1953
1990
|
@GeneralUtilities.check_arguments
|
|
1954
1991
|
def copy_constant_from_dependent_codeunit(self, codeunit_folder: str, constant_name: str, source_codeunit_name: str) -> None:
|
|
1992
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1955
1993
|
source_codeunit_folder: str = GeneralUtilities.resolve_relative_path(f"../{source_codeunit_name}", codeunit_folder)
|
|
1956
1994
|
value = self.get_constant_value(source_codeunit_folder, constant_name)
|
|
1957
1995
|
documentation = self.get_constant_documentation(source_codeunit_folder, constant_name)
|
|
@@ -1959,6 +1997,7 @@ class TasksForCommonProjectStructure:
|
|
|
1959
1997
|
|
|
1960
1998
|
@GeneralUtilities.check_arguments
|
|
1961
1999
|
def copy_resources_from_dependent_codeunit(self, codeunit_folder: str, resource_name: str, source_codeunit_name: str) -> None:
|
|
2000
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
1962
2001
|
source_folder: str = GeneralUtilities.resolve_relative_path(f"../{source_codeunit_name}/Other/Resources/{resource_name}", codeunit_folder)
|
|
1963
2002
|
target_folder: str = GeneralUtilities.resolve_relative_path(f"Other/Resources/{resource_name}", codeunit_folder)
|
|
1964
2003
|
GeneralUtilities.ensure_directory_does_not_exist(target_folder)
|
|
@@ -1970,6 +2009,7 @@ class TasksForCommonProjectStructure:
|
|
|
1970
2009
|
codeunitname = os.path.basename(str(Path(os.path.dirname(buildscript_file)).parent.parent.absolute()))
|
|
1971
2010
|
repository_folder = str(Path(os.path.dirname(buildscript_file)).parent.parent.parent.absolute())
|
|
1972
2011
|
codeunit_folder = os.path.join(repository_folder, codeunitname)
|
|
2012
|
+
self.assert_is_codeunit_folder(codeunit_folder)
|
|
1973
2013
|
artifacts_folder = os.path.join(codeunit_folder, "Other", "Artifacts")
|
|
1974
2014
|
GeneralUtilities.ensure_directory_exists(os.path.join(artifacts_folder, "APISpecification"))
|
|
1975
2015
|
verbosity = self.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
|
|
@@ -2007,6 +2047,7 @@ class TasksForCommonProjectStructure:
|
|
|
2007
2047
|
|
|
2008
2048
|
@GeneralUtilities.check_arguments
|
|
2009
2049
|
def ensure_openapigenerator_is_available(self, codeunit_folder: str) -> None:
|
|
2050
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2010
2051
|
openapigenerator_folder = os.path.join(codeunit_folder, "Other", "Resources", "OpenAPIGenerator")
|
|
2011
2052
|
internet_connection_is_available = GeneralUtilities.internet_connection_is_available()
|
|
2012
2053
|
filename = "open-api-generator.jar"
|
|
@@ -2140,6 +2181,7 @@ class TasksForCommonProjectStructure:
|
|
|
2140
2181
|
|
|
2141
2182
|
@GeneralUtilities.check_arguments
|
|
2142
2183
|
def get_dependencies_which_are_ignored_from_updates(self, codeunit_folder: str, print_warnings_for_ignored_dependencies: bool) -> list[str]:
|
|
2184
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2143
2185
|
namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure', 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
2144
2186
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
2145
2187
|
codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
|
|
@@ -2334,6 +2376,7 @@ class TasksForCommonProjectStructure:
|
|
|
2334
2376
|
|
|
2335
2377
|
@GeneralUtilities.check_arguments
|
|
2336
2378
|
def create_artifact_for_development_certificate(self, codeunit_folder: str):
|
|
2379
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2337
2380
|
ce_source_folder = GeneralUtilities.resolve_relative_path("Other/Resources/DevelopmentCertificate", codeunit_folder)
|
|
2338
2381
|
ca_source_folder = GeneralUtilities.resolve_relative_path("Other/Resources/CA", codeunit_folder)
|
|
2339
2382
|
ce_target_folder = GeneralUtilities.resolve_relative_path("Other/Artifacts/DevelopmentCertificate", codeunit_folder)
|
|
@@ -2369,7 +2412,7 @@ class TasksForCommonProjectStructure:
|
|
|
2369
2412
|
|
|
2370
2413
|
@GeneralUtilities.check_arguments
|
|
2371
2414
|
def build_codeunit(self, codeunit_folder: str, verbosity: int = 1, target_environmenttype: str = "QualityCheck", additional_arguments_file: str = None, is_pre_merge: bool = False, export_target_directory: str = None, assume_dependent_codeunits_are_already_built: bool = False, commandlinearguments: list[str] = []) -> None:
|
|
2372
|
-
|
|
2415
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2373
2416
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
2374
2417
|
repository_folder = os.path.dirname(codeunit_folder)
|
|
2375
2418
|
self.build_specific_codeunits(repository_folder, [codeunit_name], verbosity, target_environmenttype, additional_arguments_file, is_pre_merge, export_target_directory, assume_dependent_codeunits_are_already_built, commandlinearguments, False)
|
|
@@ -2426,9 +2469,10 @@ class TasksForCommonProjectStructure:
|
|
|
2426
2469
|
|
|
2427
2470
|
now = datetime.now()
|
|
2428
2471
|
if not self.__suport_information_exists(repository_folder, project_version):
|
|
2429
|
-
support_time = timedelta(days=365*2+30*3) # TODO make this configurable
|
|
2472
|
+
support_time = timedelta(days=365*2+30*3+1) # TODO make this configurable
|
|
2430
2473
|
until = now + support_time
|
|
2431
|
-
|
|
2474
|
+
until_day=datetime(until.year,until.month,until.day,0,0,0)
|
|
2475
|
+
self.mark_current_version_as_supported(repository_folder, project_version, now, until_day)
|
|
2432
2476
|
|
|
2433
2477
|
if len(sorted_codeunits) == 0:
|
|
2434
2478
|
raise ValueError(f'No codeunit found in subfolders of "{repository_folder}".')
|
|
@@ -2520,6 +2564,7 @@ class TasksForCommonProjectStructure:
|
|
|
2520
2564
|
|
|
2521
2565
|
@GeneralUtilities.check_arguments
|
|
2522
2566
|
def __ensure_grylibrary_is_available(self, codeunit_folder: str) -> None:
|
|
2567
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2523
2568
|
grylibrary_folder = os.path.join(codeunit_folder, "Other", "Resources", "GRYLibrary")
|
|
2524
2569
|
grylibrary_dll_file = os.path.join(grylibrary_folder, "BuildResult_DotNet_win-x64", "GRYLibrary.dll")
|
|
2525
2570
|
internet_connection_is_available = GeneralUtilities.internet_connection_is_available()
|
|
@@ -2551,6 +2596,7 @@ class TasksForCommonProjectStructure:
|
|
|
2551
2596
|
|
|
2552
2597
|
@GeneralUtilities.check_arguments
|
|
2553
2598
|
def ensure_ffmpeg_is_available(self, codeunit_folder: str) -> None:
|
|
2599
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2554
2600
|
ffmpeg_folder = os.path.join(codeunit_folder, "Other", "Resources", "FFMPEG")
|
|
2555
2601
|
internet_connection_is_available = GeneralUtilities.internet_connection_is_available()
|
|
2556
2602
|
exe_file = f"{ffmpeg_folder}/ffmpeg.exe"
|
|
@@ -2637,6 +2683,7 @@ class TasksForCommonProjectStructure:
|
|
|
2637
2683
|
|
|
2638
2684
|
@GeneralUtilities.check_arguments
|
|
2639
2685
|
def create_deb_package_for_artifact(self, codeunit_folder: str, maintainername: str, maintaineremail: str, description: str, verbosity: int, cmd_arguments: list[str]) -> None:
|
|
2686
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2640
2687
|
verbosity = self.get_verbosity_from_commandline_arguments(cmd_arguments, verbosity)
|
|
2641
2688
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
2642
2689
|
binary_folder = GeneralUtilities.resolve_relative_path("Other/Artifacts/BuildResult_DotNet_linux-x64", codeunit_folder)
|
|
@@ -2660,6 +2707,7 @@ class TasksForCommonProjectStructure:
|
|
|
2660
2707
|
|
|
2661
2708
|
@GeneralUtilities.check_arguments
|
|
2662
2709
|
def update_year_for_dotnet_codeunit(self, codeunit_folder: str) -> None:
|
|
2710
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2663
2711
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
2664
2712
|
csproj_file = os.path.join(codeunit_folder, codeunit_name, f"{codeunit_name}.csproj")
|
|
2665
2713
|
self.__sc.update_year_in_copyright_tags(csproj_file)
|
|
@@ -2675,6 +2723,7 @@ class TasksForCommonProjectStructure:
|
|
|
2675
2723
|
|
|
2676
2724
|
@GeneralUtilities.check_arguments
|
|
2677
2725
|
def verify_artifact_exists(self, codeunit_folder: str, artifact_name_regexes: dict[str, bool]) -> None:
|
|
2726
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2678
2727
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
2679
2728
|
artifacts_folder = os.path.join(codeunit_folder, "Other/Artifacts")
|
|
2680
2729
|
existing_artifacts = [os.path.basename(x) for x in GeneralUtilities.get_direct_folders_of_folder(artifacts_folder)]
|
|
@@ -2693,6 +2742,7 @@ class TasksForCommonProjectStructure:
|
|
|
2693
2742
|
|
|
2694
2743
|
@GeneralUtilities.check_arguments
|
|
2695
2744
|
def __build_codeunit(self, codeunit_folder: str, verbosity: int = 1, target_environmenttype: str = "QualityCheck", additional_arguments_file: str = None, is_pre_merge: bool = False, assume_dependent_codeunits_are_already_built: bool = False, commandline_arguments: list[str] = []) -> None:
|
|
2745
|
+
TasksForCommonProjectStructure.assert_is_codeunit_folder(codeunit_folder)
|
|
2696
2746
|
now = datetime.now()
|
|
2697
2747
|
codeunit_folder = GeneralUtilities.resolve_relative_path_from_current_working_directory(codeunit_folder)
|
|
2698
2748
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
ScriptCollection/Executables.py,sha256=ls3wGZpt48YwwtO0QGWWyIImSE87SyzbL-WxhpwQJug,20837
|
|
2
|
-
ScriptCollection/GeneralUtilities.py,sha256=
|
|
2
|
+
ScriptCollection/GeneralUtilities.py,sha256=Kh_oSUtCyBra5LuH5_5_HkyM14YvA21ug8cK4ODsamI,37744
|
|
3
3
|
ScriptCollection/ProcessesRunner.py,sha256=3mu4ZxzZleQo0Op6o9EYTCFiJfb6kx5ov2YfZfT89mU,1395
|
|
4
4
|
ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-T54IJcHQ,2324
|
|
5
5
|
ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
|
|
6
6
|
ScriptCollection/ProgramRunnerPopen.py,sha256=UGWUK0345DmtnD1gsKa1B3tBLDzKKXUGnSbIuCSWzLU,3714
|
|
7
7
|
ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
|
|
8
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
9
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=
|
|
8
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=CgWu2xqIYMu06BJLsBtCZ3v_GNgqzUU84xCtNKyC3O4,106702
|
|
9
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=w19PqN9ICOF7vF9Muxbs-t5wPPh1qqJUvxsY5QAfpB8,213960
|
|
10
10
|
ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
|
|
11
11
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ScriptCollection-3.5.
|
|
13
|
-
ScriptCollection-3.5.
|
|
14
|
-
ScriptCollection-3.5.
|
|
15
|
-
ScriptCollection-3.5.
|
|
16
|
-
ScriptCollection-3.5.
|
|
12
|
+
ScriptCollection-3.5.49.dist-info/METADATA,sha256=aqDa6blUTgJpB6VFlVPGx0SjJwBJWye0lt9ihAl2R_s,7665
|
|
13
|
+
ScriptCollection-3.5.49.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
14
|
+
ScriptCollection-3.5.49.dist-info/entry_points.txt,sha256=_O7BmQ81LdDfrj5uOhjshg9Xc-tABHQJIxDOyOGRzzI,2397
|
|
15
|
+
ScriptCollection-3.5.49.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
16
|
+
ScriptCollection-3.5.49.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|