ScriptCollection 4.0.41__py3-none-any.whl → 4.0.43__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 +18 -1
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py +2 -2
- ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py +84 -4
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py +1 -1
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +13 -4
- {scriptcollection-4.0.41.dist-info → scriptcollection-4.0.43.dist-info}/METADATA +1 -1
- {scriptcollection-4.0.41.dist-info → scriptcollection-4.0.43.dist-info}/RECORD +10 -10
- {scriptcollection-4.0.41.dist-info → scriptcollection-4.0.43.dist-info}/WHEEL +0 -0
- {scriptcollection-4.0.41.dist-info → scriptcollection-4.0.43.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.0.41.dist-info → scriptcollection-4.0.43.dist-info}/top_level.txt +0 -0
@@ -37,7 +37,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
37
37
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
38
38
|
from .SCLog import SCLog, LogLevel
|
39
39
|
|
40
|
-
version = "4.0.
|
40
|
+
version = "4.0.43"
|
41
41
|
__version__ = version
|
42
42
|
|
43
43
|
|
@@ -2509,3 +2509,20 @@ OCR-content:
|
|
2509
2509
|
file_path = os.path.join(root, file)
|
2510
2510
|
arcname = os.path.relpath(file_path, start=folder)
|
2511
2511
|
zipf.write(file_path, arcname)
|
2512
|
+
|
2513
|
+
@GeneralUtilities.check_arguments
|
2514
|
+
def start_local_test_service(self, file: str):
|
2515
|
+
example_folder = os.path.dirname(file)
|
2516
|
+
docker_compose_file = os.path.join(example_folder, "docker-compose.yml")
|
2517
|
+
for service in self.get_services_from_yaml_file(docker_compose_file):
|
2518
|
+
self.kill_docker_container(service)
|
2519
|
+
example_name = os.path.basename(example_folder)
|
2520
|
+
title = f"Test{example_name}"
|
2521
|
+
self.run_program("docker", f"compose -p {title.lower()} up --detach", example_folder, title=title)
|
2522
|
+
|
2523
|
+
@GeneralUtilities.check_arguments
|
2524
|
+
def stop_local_test_service(self, file: str):
|
2525
|
+
example_folder = os.path.dirname(file)
|
2526
|
+
example_name = os.path.basename(example_folder)
|
2527
|
+
title = f"Test{example_name}"
|
2528
|
+
self.run_program("docker", f"compose -p {title.lower()} down", example_folder, title=title)
|
@@ -291,7 +291,7 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
291
291
|
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Productive'\\\">
|
292
292
|
<DebugType>portable<\\/DebugType>
|
293
293
|
<DebugSymbols>true<\\/DebugSymbols>
|
294
|
-
<Optimize>
|
294
|
+
<Optimize>false<\\/Optimize>
|
295
295
|
<DefineConstants>Productive<\\/DefineConstants>
|
296
296
|
<ErrorReport>none<\\/ErrorReport>
|
297
297
|
<\\/PropertyGroup>(\\n|.)*
|
@@ -355,7 +355,7 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
355
355
|
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Productive'\\\">
|
356
356
|
<DebugType>portable<\\/DebugType>
|
357
357
|
<DebugSymbols>true<\\/DebugSymbols>
|
358
|
-
<Optimize>
|
358
|
+
<Optimize>false<\\/Optimize>
|
359
359
|
<DefineConstants>Productive<\\/DefineConstants>
|
360
360
|
<ErrorReport>none<\\/ErrorReport>
|
361
361
|
<\\/PropertyGroup>(\\n|.)*
|
@@ -1,3 +1,7 @@
|
|
1
|
+
import os
|
2
|
+
import shutil
|
3
|
+
import re
|
4
|
+
import zipfile
|
1
5
|
from ...GeneralUtilities import GeneralUtilities
|
2
6
|
from ...SCLog import LogLevel
|
3
7
|
from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base,TFCPS_CodeUnitSpecific_Base_CLI
|
@@ -9,8 +13,62 @@ class TFCPS_CodeUnitSpecific_Flutter_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
9
13
|
|
10
14
|
|
11
15
|
@GeneralUtilities.check_arguments
|
12
|
-
def build(self) -> None:
|
13
|
-
|
16
|
+
def build(self,package_name:str,targets:list[str]) -> None:
|
17
|
+
codeunit_folder = self.get_codeunit_folder()
|
18
|
+
codeunit_name = os.path.basename(codeunit_folder)
|
19
|
+
src_folder: str = None
|
20
|
+
if package_name is None:
|
21
|
+
src_folder = codeunit_folder
|
22
|
+
else:
|
23
|
+
src_folder = GeneralUtilities.resolve_relative_path(package_name, codeunit_folder) # TODO replace packagename
|
24
|
+
artifacts_folder = os.path.join(codeunit_folder, "Other", "Artifacts")
|
25
|
+
|
26
|
+
target_names: dict[str, str] = {
|
27
|
+
"web": "WebApplication",
|
28
|
+
"windows": "Windows",
|
29
|
+
"ios": "IOS",
|
30
|
+
"appbundle": "Android",
|
31
|
+
}
|
32
|
+
for target in targets:
|
33
|
+
self._protected_sc.log.log(f"Build flutter-codeunit {codeunit_name} for target {target_names[target]}...")
|
34
|
+
self._protected_sc.run_with_epew("flutter", f"build {target}", src_folder)
|
35
|
+
if target == "web":
|
36
|
+
web_relase_folder = os.path.join(src_folder, "build/web")
|
37
|
+
web_folder = os.path.join(artifacts_folder, "BuildResult_WebApplication")
|
38
|
+
GeneralUtilities.ensure_directory_does_not_exist(web_folder)
|
39
|
+
GeneralUtilities.ensure_directory_exists(web_folder)
|
40
|
+
GeneralUtilities.copy_content_of_folder(web_relase_folder, web_folder)
|
41
|
+
elif target == "windows":
|
42
|
+
windows_release_folder = os.path.join(src_folder, "build/windows/x64/runner/Release")
|
43
|
+
windows_folder = os.path.join(artifacts_folder, "BuildResult_Windows")
|
44
|
+
GeneralUtilities.ensure_directory_does_not_exist(windows_folder)
|
45
|
+
GeneralUtilities.ensure_directory_exists(windows_folder)
|
46
|
+
GeneralUtilities.copy_content_of_folder(windows_release_folder, windows_folder)
|
47
|
+
elif target == "ios":
|
48
|
+
raise ValueError("building for ios is not implemented yet")
|
49
|
+
elif target == "appbundle":
|
50
|
+
aab_folder = os.path.join(artifacts_folder, "BuildResult_AAB")
|
51
|
+
GeneralUtilities.ensure_directory_does_not_exist(aab_folder)
|
52
|
+
GeneralUtilities.ensure_directory_exists(aab_folder)
|
53
|
+
aab_relase_folder = os.path.join(src_folder, "build/app/outputs/bundle/release")
|
54
|
+
aab_file_original = self._protected_sc.find_file_by_extension(aab_relase_folder, "aab")
|
55
|
+
aab_file = os.path.join(aab_folder, f"{codeunit_name}.aab")
|
56
|
+
shutil.copyfile(aab_file_original, aab_file)
|
57
|
+
|
58
|
+
bundletool = self.tfcps_Tools_General.ensure_androidappbundletool_is_available(None,self.use_cache())
|
59
|
+
apk_folder = os.path.join(artifacts_folder, "BuildResult_APK")
|
60
|
+
GeneralUtilities.ensure_directory_does_not_exist(apk_folder)
|
61
|
+
GeneralUtilities.ensure_directory_exists(apk_folder)
|
62
|
+
apks_file = f"{apk_folder}/{codeunit_name}.apks"
|
63
|
+
self._protected_sc.run_program("java", f"-jar {bundletool} build-apks --bundle={aab_file} --output={apks_file} --mode=universal", aab_relase_folder)
|
64
|
+
with zipfile.ZipFile(apks_file, "r") as zip_ref:
|
65
|
+
zip_ref.extract("universal.apk", apk_folder)
|
66
|
+
GeneralUtilities.ensure_file_does_not_exist(apks_file)
|
67
|
+
os.rename(f"{apk_folder}/universal.apk", f"{apk_folder}/{codeunit_name}.apk")
|
68
|
+
else:
|
69
|
+
raise ValueError(f"Not supported target: {target}")
|
70
|
+
self.copy_source_files_to_output_directory()
|
71
|
+
#TODO check for updateable dependencies (in a unified way)
|
14
72
|
|
15
73
|
@GeneralUtilities.check_arguments
|
16
74
|
def linting(self) -> None:
|
@@ -29,9 +87,31 @@ class TFCPS_CodeUnitSpecific_Flutter_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
29
87
|
pass#TODO
|
30
88
|
|
31
89
|
@GeneralUtilities.check_arguments
|
32
|
-
def run_testcases(self) -> None:
|
33
|
-
|
90
|
+
def run_testcases(self,package_name:str) -> None:
|
91
|
+
codeunit_folder = self.get_codeunit_folder()
|
92
|
+
repository_folder = GeneralUtilities.resolve_relative_path("..", codeunit_folder)
|
93
|
+
codeunit_name = os.path.basename(codeunit_folder)
|
94
|
+
src_folder = GeneralUtilities.resolve_relative_path(package_name, codeunit_folder)
|
95
|
+
|
96
|
+
self._protected_sc.run_with_epew("flutter", "test --coverage", src_folder)
|
97
|
+
test_coverage_folder_relative = "Other/Artifacts/TestCoverage"
|
98
|
+
test_coverage_folder = GeneralUtilities.resolve_relative_path(test_coverage_folder_relative, codeunit_folder)
|
99
|
+
GeneralUtilities.ensure_directory_exists(test_coverage_folder)
|
100
|
+
coverage_file_relative = f"{test_coverage_folder_relative}/TestCoverage.xml"
|
101
|
+
coverage_file = GeneralUtilities.resolve_relative_path(coverage_file_relative, codeunit_folder)
|
102
|
+
self._protected_sc.run_with_epew("lcov_cobertura", f"coverage/lcov.info --base-dir . --excludes test --output ../{coverage_file_relative} --demangle", src_folder)
|
34
103
|
|
104
|
+
# format correctly
|
105
|
+
content = GeneralUtilities.read_text_from_file(coverage_file)
|
106
|
+
content = re.sub('<![^<]+>', '', content)
|
107
|
+
content = re.sub('\\\\', '/', content)
|
108
|
+
content = re.sub('\\ name=\\"lib\\"', '', content)
|
109
|
+
content = re.sub('\\ filename=\\"lib/', f' filename="{package_name}/lib/', content)
|
110
|
+
GeneralUtilities.write_text_to_file(coverage_file, content)
|
111
|
+
self.tfcps_Tools_General.merge_packages(coverage_file, self.get_codeunit_name())
|
112
|
+
self.tfcps_Tools_General.calculate_entire_line_rate(coverage_file)
|
113
|
+
self.run_testcases_common_post_task(repository_folder, codeunit_name, True, self.get_target_environment_type())
|
114
|
+
|
35
115
|
class TFCPS_CodeUnitSpecific_Flutter_CLI:
|
36
116
|
|
37
117
|
@staticmethod
|
@@ -369,7 +369,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
369
369
|
found_existing_files = True
|
370
370
|
else:
|
371
371
|
coverage_report_class.getparent().remove(coverage_report_class)
|
372
|
-
GeneralUtilities.assert_condition(found_existing_files, f"No existing files in
|
372
|
+
GeneralUtilities.assert_condition(found_existing_files, f"No existing files in testcoverage-report-file \"{testcoveragefile}\".")
|
373
373
|
result = etree.tostring(root).decode("utf-8")
|
374
374
|
GeneralUtilities.write_text_to_file(testcoveragefile, result)
|
375
375
|
|
@@ -897,7 +897,7 @@ class TFCPS_Tools_General:
|
|
897
897
|
GeneralUtilities.ensure_folder_exists_and_is_empty(target_folder)
|
898
898
|
GeneralUtilities.copy_content_of_folder(source_folder, target_folder)
|
899
899
|
|
900
|
-
|
900
|
+
|
901
901
|
@GeneralUtilities.check_arguments
|
902
902
|
def merge_packages(self,coverage_file:str,package_name:str) -> None:
|
903
903
|
tree = etree.parse(coverage_file)
|
@@ -906,7 +906,7 @@ class TFCPS_Tools_General:
|
|
906
906
|
all_classes = []
|
907
907
|
for pkg in packages:
|
908
908
|
pkg_name:str=pkg.get("name")
|
909
|
-
if pkg_name==package_name or pkg_name.startswith(f"{package_name}."):
|
909
|
+
if len(packages)==1 or ( pkg_name==package_name or pkg_name.startswith(f"{package_name}.")):
|
910
910
|
classes = pkg.find("classes")
|
911
911
|
if classes is not None:
|
912
912
|
all_classes.extend(classes.findall("class"))
|
@@ -918,11 +918,11 @@ class TFCPS_Tools_General:
|
|
918
918
|
packages_node.clear()
|
919
919
|
packages_node.append(new_package)
|
920
920
|
tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
|
921
|
-
self.
|
921
|
+
self.calculate_entire_line_rate(coverage_file)
|
922
922
|
|
923
923
|
|
924
924
|
@GeneralUtilities.check_arguments
|
925
|
-
def
|
925
|
+
def calculate_entire_line_rate(self,coverage_file:str) -> None:
|
926
926
|
tree = etree.parse(coverage_file)
|
927
927
|
root = tree.getroot()
|
928
928
|
package = root.find("./packages/package")
|
@@ -943,6 +943,7 @@ class TFCPS_Tools_General:
|
|
943
943
|
package.set("line-rate", str(line_rate))
|
944
944
|
tree.write(coverage_file, pretty_print=True, xml_declaration=True, encoding="UTF-8")
|
945
945
|
|
946
|
+
|
946
947
|
@GeneralUtilities.check_arguments
|
947
948
|
def generate_api_client_from_dependent_codeunit_for_angular(self, codeunit_folder:str, name_of_api_providing_codeunit: str, generated_program_part_name: str,language:str,use_cache:bool) -> None:
|
948
949
|
target_subfolder_in_codeunit = f"src/app/generated/{generated_program_part_name}"
|
@@ -1150,3 +1151,11 @@ class TFCPS_Tools_General:
|
|
1150
1151
|
self.__sc.run_program_with_retry("docker", f"push {remote_image_version}")
|
1151
1152
|
if push_readme:
|
1152
1153
|
self.__sc.run_program_with_retry("docker-pushrm", f"{remote_repo}", codeunit_folder)
|
1154
|
+
|
1155
|
+
def prepare_building_codeunits(self,repository_folder:str,use_cache:bool,generate_development_certificate:bool):
|
1156
|
+
if generate_development_certificate:
|
1157
|
+
self.ensure_certificate_authority_for_development_purposes_is_generated(repository_folder)
|
1158
|
+
self.generate_certificate_for_development_purposes_for_product(repository_folder)
|
1159
|
+
self.generate_tasksfile_from_workspace_file(repository_folder)
|
1160
|
+
self.generate_codeunits_overview_diagram(repository_folder)
|
1161
|
+
self.generate_svg_files_from_plantuml_files_for_repository(repository_folder,use_cache)
|
@@ -9,9 +9,9 @@ ScriptCollection/ProgramRunnerEpew.py,sha256=TJdDx9zIMSiCaXh8X-ekrMlbXfGtmd0Mmyx
|
|
9
9
|
ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrRjAPIwT5Y,37
|
10
10
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
11
11
|
ScriptCollection/SCLog.py,sha256=dxGOI4E9lG5v9jk_LajXCkM5nghliCDV8YB8Ihn160s,4541
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=hzraZbT2qQrny90RSK55aVMmrQPMPIiHAiB35Coj8U4,142098
|
13
13
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=
|
14
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=2Ng-GyKWQ6FfTUmogd7g-xF6_XeTMxvkeJddagxFR5o,25853
|
15
15
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=4rYKgTAga11NiDx8YUqz3K_Q4eX_n3kC6lvNdXEa24s,7389
|
16
16
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=h3PWj7SgJF9huMognPpfNwGb9E9Y9HQ0Ym72yvvJwwg,5676
|
17
17
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=bcJlfI062Eoq7MOIhun-_iNG7SdO1ZIuC_cylaoLI1s,6332
|
@@ -20,23 +20,23 @@ ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=41g219jaBRZ2VQCrWM4-Trvervrt8
|
|
20
20
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=ifB1K6A903vvfH0LvtiFbZgYSgR94thfEI-jjf40LpU,21653
|
21
21
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=CxdwUklhZVuJGp0vcokoH_KMXFzmlUlZwj77xFYijho,2242
|
22
22
|
ScriptCollection/TFCPS/TFCPS_Tools_Dependencies.py,sha256=o7HI3ki3WWqlAiUsrh3Lky_w6UhYh9hdjYPGOhubQGA,414
|
23
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
23
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=S_uQX8kmjntIe8b_3FVh7ABgPCBcLCCpmewMv2gVvD4,73160
|
24
24
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=-g8h2gCf9rh0KJXUBeQD5d0qLJgBU3Q8DNZXM1UXC04,5259
|
26
26
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
|
28
28
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
|
29
29
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
|
30
|
-
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=
|
30
|
+
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=myR8hG2RMGg59S6Rf0Ts7R7df2IIVFDkazu4XSmSvrA,31001
|
31
31
|
ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
32
|
-
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=
|
32
|
+
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=TIR95f6TVOnW25ieX9q4RUi1FogbYEfrlZOcZ1aE014,6969
|
33
33
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
34
|
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=dnuDlQXThFmhe6EbUAWmGhx7AAYGL0lVUqsrhOgtmC8,6255
|
35
35
|
ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=q7msAxCb5VIZ-xhFg1MfzUvWomQRKYldqmW42KFhyMU,6868
|
37
37
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
-
scriptcollection-4.0.
|
39
|
-
scriptcollection-4.0.
|
40
|
-
scriptcollection-4.0.
|
41
|
-
scriptcollection-4.0.
|
42
|
-
scriptcollection-4.0.
|
38
|
+
scriptcollection-4.0.43.dist-info/METADATA,sha256=gUEW02jG627c1YV8_WeShyqVa8XFVr8NWTiyn1UMfYc,7688
|
39
|
+
scriptcollection-4.0.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
40
|
+
scriptcollection-4.0.43.dist-info/entry_points.txt,sha256=NeU26D6q7d8n2cmKQiOvHK21w1C7D2kxoNRJaKiyZ5w,4295
|
41
|
+
scriptcollection-4.0.43.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
42
|
+
scriptcollection-4.0.43.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|