ScriptCollection 3.5.163__py3-none-any.whl → 3.5.164__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/ScriptCollectionCore.py +1 -1
- ScriptCollection/TasksForCommonProjectStructure.py +38 -10
- {scriptcollection-3.5.163.dist-info → scriptcollection-3.5.164.dist-info}/METADATA +1 -1
- {scriptcollection-3.5.163.dist-info → scriptcollection-3.5.164.dist-info}/RECORD +7 -7
- {scriptcollection-3.5.163.dist-info → scriptcollection-3.5.164.dist-info}/WHEEL +0 -0
- {scriptcollection-3.5.163.dist-info → scriptcollection-3.5.164.dist-info}/entry_points.txt +0 -0
- {scriptcollection-3.5.163.dist-info → scriptcollection-3.5.164.dist-info}/top_level.txt +0 -0
@@ -532,17 +532,19 @@ class TasksForCommonProjectStructure:
|
|
532
532
|
|
533
533
|
csproj_project_name = codeunit_name
|
534
534
|
csproj_file = os.path.join(codeunit_folder, csproj_project_name, csproj_project_name+".csproj")
|
535
|
-
result1: tuple[bool, str] = self.__standardized_task_verify_standard_format_for_project_csproj_file(csproj_file, codeunit_folder, codeunit_name, codeunit_version)
|
535
|
+
result1: tuple[bool, str, list[str]] = self.__standardized_task_verify_standard_format_for_project_csproj_file(csproj_file, codeunit_folder, codeunit_name, codeunit_version)
|
536
536
|
if not result1[0]:
|
537
|
-
|
537
|
+
hints: str = "\n".join(result1[2])
|
538
|
+
raise ValueError(f"'{csproj_file}' with content '{GeneralUtilities.read_text_from_file(csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result1[1]}'.\n{hints}")
|
538
539
|
|
539
540
|
test_csproj_project_name = csproj_project_name+"Tests"
|
540
541
|
test_csproj_file = os.path.join(codeunit_folder, test_csproj_project_name, test_csproj_project_name+".csproj")
|
541
|
-
result2: tuple[bool, str] = self.__standardized_task_verify_standard_format_for_test_csproj_file(test_csproj_file, codeunit_name, codeunit_version)
|
542
|
+
result2: tuple[bool, str, list[str]] = self.__standardized_task_verify_standard_format_for_test_csproj_file(test_csproj_file, codeunit_name, codeunit_version)
|
542
543
|
if not result2[0]:
|
543
|
-
|
544
|
+
hints: str = "\n".join(result2[2])
|
545
|
+
raise ValueError(f"'{test_csproj_file}' with content '{GeneralUtilities.read_text_from_file(test_csproj_file)}' does not match the standardized .csproj-file-format which is defined by the regex '{result2[1]}'.\n{hints}")
|
544
546
|
|
545
|
-
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]:
|
547
|
+
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, str]:
|
546
548
|
self.assert_is_codeunit_folder(codeunit_folder)
|
547
549
|
codeunit_name_regex = re.escape(codeunit_name)
|
548
550
|
codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
|
@@ -608,9 +610,10 @@ class TasksForCommonProjectStructure:
|
|
608
610
|
<ErrorReport>none<\\/ErrorReport>
|
609
611
|
<\\/PropertyGroup>(\\n|.)*
|
610
612
|
<\\/Project>$"""
|
611
|
-
|
613
|
+
result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
|
614
|
+
return (result[0], regex, result[1])
|
612
615
|
|
613
|
-
def __standardized_task_verify_standard_format_for_test_csproj_file(self, csproj_file: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str]:
|
616
|
+
def __standardized_task_verify_standard_format_for_test_csproj_file(self, csproj_file: str, codeunit_name: str, codeunit_version: str) -> tuple[bool, str, str]:
|
614
617
|
codeunit_name_regex = re.escape(codeunit_name)
|
615
618
|
codeunit_version_regex = re.escape(codeunit_version)
|
616
619
|
regex = f"""^<Project Sdk=\\"Microsoft\\.NET\\.Sdk\\">
|
@@ -671,16 +674,41 @@ class TasksForCommonProjectStructure:
|
|
671
674
|
<ErrorReport>none<\\/ErrorReport>
|
672
675
|
<\\/PropertyGroup>(\\n|.)*
|
673
676
|
<\\/Project>$"""
|
674
|
-
|
677
|
+
result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
|
678
|
+
return (result[0], regex, result[1])
|
675
679
|
|
676
|
-
def __standardized_task_verify_standard_format_for_csproj_files(self, regex: str, csproj_file: str) -> bool:
|
680
|
+
def __standardized_task_verify_standard_format_for_csproj_files(self, regex: str, csproj_file: str) -> tuple[bool, list[str]]:
|
677
681
|
filename = os.path.basename(csproj_file)
|
678
682
|
GeneralUtilities.write_message_to_stdout(f"Check {filename}...")
|
679
683
|
file_content = GeneralUtilities.read_text_from_file(csproj_file)
|
680
684
|
regex = regex.replace("\r", GeneralUtilities.empty_string).replace("\n", "\\n")
|
681
685
|
file_content = file_content.replace("\r", GeneralUtilities.empty_string)
|
682
686
|
match = re.match(regex, file_content)
|
683
|
-
|
687
|
+
result = match is not None
|
688
|
+
hints = None
|
689
|
+
if not result:
|
690
|
+
hints = self.get_hints_for_csproj()
|
691
|
+
return (result, hints)
|
692
|
+
|
693
|
+
@GeneralUtilities.check_arguments
|
694
|
+
def get_hints_for_csproj(self) -> list[str]:
|
695
|
+
result: list[str] = []
|
696
|
+
with open("string.txt", "r", encoding="utf-8") as f:
|
697
|
+
strings = [line.rstrip("\n") for line in f]
|
698
|
+
|
699
|
+
with open("regex.txt", "r", encoding="utf-8") as f:
|
700
|
+
regexes = [line.rstrip("\n") for line in f]
|
701
|
+
|
702
|
+
amount_of_lines = len(regexes)
|
703
|
+
if len(strings) < amount_of_lines:
|
704
|
+
result.append("csproj-file has less lines than the regex requires.")
|
705
|
+
return result
|
706
|
+
for i in range(amount_of_lines - 1):
|
707
|
+
s = strings[i]
|
708
|
+
r = regexes[i]
|
709
|
+
if not re.match(r, s):
|
710
|
+
result.append(f"Line {i+1} does not match: Regex='{r}' String='{s}'")
|
711
|
+
return result
|
684
712
|
|
685
713
|
@GeneralUtilities.check_arguments
|
686
714
|
def __standardized_tasks_build_for_dotnet_build(self, csproj_file: str, originaloutputfolder: str, files_to_sign: dict[str, str], commitid: str, verbosity: int, runtimes: list[str], target_environmenttype: str, target_environmenttype_mapping: dict[str, str], copy_license_file_to_target_folder: bool, repository_folder: str, codeunit_name: str, commandline_arguments: list[str]) -> None:
|
@@ -7,11 +7,11 @@ ScriptCollection/ProgramRunnerBase.py,sha256=2kMIAqdc65UjBAddOZkzy_aFx9h5roZ5a4b
|
|
7
7
|
ScriptCollection/ProgramRunnerEpew.py,sha256=4pjEd0r9Fcz3TTDv0MdTSd5KkigYXcWUVI1X43regfU,6477
|
8
8
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
9
9
|
ScriptCollection/SCLog.py,sha256=rMdrEzBKQZBdObPJ9nZ5XCEXRoIFqPh8fAoiX6ZOVuw,4493
|
10
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
11
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=
|
10
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=TwbQyNauisK5iRVRQt5JVDPM7xSPR1-XGv-0-BHY_3I,141742
|
11
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=l3ZBmN60S-rJySg7rA5ShQmtAb6DbWxeJsQsypfd8Z4,251694
|
12
12
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
scriptcollection-3.5.
|
14
|
-
scriptcollection-3.5.
|
15
|
-
scriptcollection-3.5.
|
16
|
-
scriptcollection-3.5.
|
17
|
-
scriptcollection-3.5.
|
13
|
+
scriptcollection-3.5.164.dist-info/METADATA,sha256=BOZUlLK1m1PR87cMyub9vd0e78vc3qePhkpQBuY3Uec,7689
|
14
|
+
scriptcollection-3.5.164.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
15
|
+
scriptcollection-3.5.164.dist-info/entry_points.txt,sha256=EBRDrnGDURysHNyK0Z0fPCnL7uCCO_Mxc6WYJ47KxAI,4234
|
16
|
+
scriptcollection-3.5.164.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
17
|
+
scriptcollection-3.5.164.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|