ScriptCollection 4.2.77__py3-none-any.whl → 4.2.79__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/Executables.py +9 -1
- ScriptCollection/GeneralUtilities.py +1 -0
- ScriptCollection/OCIImages/AbstractImageHandler.py +7 -3
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py +7 -2
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py +7 -2
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGeneric.py +7 -2
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGenericV.py +7 -2
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabCE.py +21 -0
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabEE.py +21 -0
- ScriptCollection/OCIImages/OCIImageManager.py +81 -11
- ScriptCollection/ScriptCollectionCore.py +21 -12
- ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py +3 -2
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py +158 -117
- ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py +43 -0
- ScriptCollection/TFCPS/Maven/__init__.py +0 -0
- ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py +43 -0
- ScriptCollection/TFCPS/Rust/__init__.py +0 -0
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +1 -1
- ScriptCollection/__pycache__/GeneralUtilities.cpython-311.pyc +0 -0
- ScriptCollection/__pycache__/__init__.cpython-311.pyc +0 -0
- {scriptcollection-4.2.77.dist-info → scriptcollection-4.2.79.dist-info}/METADATA +3 -3
- {scriptcollection-4.2.77.dist-info → scriptcollection-4.2.79.dist-info}/RECORD +25 -17
- {scriptcollection-4.2.77.dist-info → scriptcollection-4.2.79.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.77.dist-info → scriptcollection-4.2.79.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.2.77.dist-info → scriptcollection-4.2.79.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -10,6 +10,7 @@ from .GeneralUtilities import GeneralUtilities
|
|
|
10
10
|
from .SCLog import LogLevel, SCLog
|
|
11
11
|
from .TFCPS.TFCPS_CodeUnit_BuildCodeUnits import TFCPS_CodeUnit_BuildCodeUnits
|
|
12
12
|
from .TFCPS.TFCPS_Tools_General import TFCPS_Tools_General
|
|
13
|
+
from .OCIImages.OCIImageManager import OCIImageManager
|
|
13
14
|
|
|
14
15
|
def FilenameObfuscator() -> int:
|
|
15
16
|
parser = argparse.ArgumentParser(description=''''Obfuscates the names of all files in the given folder.
|
|
@@ -745,7 +746,14 @@ def OCRAnalysisOfRepository() -> int:
|
|
|
745
746
|
|
|
746
747
|
|
|
747
748
|
def UpdateImagesInDockerComposeFile() -> int:
|
|
748
|
-
|
|
749
|
+
parser = argparse.ArgumentParser(description="This function updates images in a Docker Compose file.")
|
|
750
|
+
parser.add_argument('-f', '--file', required=False,default="./docker-compose.yml")
|
|
751
|
+
#TODO add possibility to set version-echolon for each image specifically and pass this information to OCIImageManager
|
|
752
|
+
args = parser.parse_args()
|
|
753
|
+
sc = ScriptCollectionCore()
|
|
754
|
+
file=GeneralUtilities.resolve_relative_path(args.file, os.getcwd())
|
|
755
|
+
oci=OCIImageManager(sc)
|
|
756
|
+
oci.update_image_in_docker_compose_file(file)
|
|
749
757
|
return 0
|
|
750
758
|
|
|
751
759
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
from packaging.version import Version
|
|
3
|
-
from ..GeneralUtilities import GeneralUtilities
|
|
3
|
+
from ..GeneralUtilities import GeneralUtilities, VersionEcholon
|
|
4
4
|
|
|
5
5
|
class AbstractImageHandler(ABC):
|
|
6
6
|
|
|
@@ -26,9 +26,13 @@ class AbstractImageHandler(ABC):
|
|
|
26
26
|
raise NotImplementedError()#because it is abstract
|
|
27
27
|
|
|
28
28
|
@abstractmethod
|
|
29
|
-
def tag_to_version(self,image_name:str,
|
|
29
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
30
30
|
raise NotImplementedError()#because it is abstract
|
|
31
31
|
|
|
32
32
|
@abstractmethod
|
|
33
|
-
def version_to_tag(self,image_name:str,
|
|
33
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
34
|
+
raise NotImplementedError()#because it is abstract
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
34
38
|
raise NotImplementedError()#because it is abstract
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.build.lib.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
2
4
|
from ..AbstractImageHandler import AbstractImageHandler
|
|
3
5
|
|
|
4
6
|
class ImageHandlerDebian(AbstractImageHandler):
|
|
@@ -9,8 +11,11 @@ class ImageHandlerDebian(AbstractImageHandler):
|
|
|
9
11
|
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
10
12
|
raise NotImplementedError()
|
|
11
13
|
|
|
12
|
-
def tag_to_version(self,image_name:str,
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
13
15
|
raise NotImplementedError()
|
|
14
16
|
|
|
15
|
-
def version_to_tag(self,image_name:str,
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
16
18
|
raise NotImplementedError()
|
|
19
|
+
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
21
|
+
return VersionEcholon.LatestPatch
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
2
4
|
from ..AbstractImageHandler import AbstractImageHandler
|
|
3
5
|
|
|
4
6
|
class ImageHandlerDebianSlim(AbstractImageHandler):
|
|
@@ -9,8 +11,11 @@ class ImageHandlerDebianSlim(AbstractImageHandler):
|
|
|
9
11
|
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
10
12
|
raise NotImplementedError()
|
|
11
13
|
|
|
12
|
-
def tag_to_version(self,image_name:str,
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
13
15
|
raise NotImplementedError()
|
|
14
16
|
|
|
15
|
-
def version_to_tag(self,image_name:str,
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
16
18
|
raise NotImplementedError()
|
|
19
|
+
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
21
|
+
return VersionEcholon.LatestPatch
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.build.lib.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
2
4
|
from ..AbstractImageHandler import AbstractImageHandler
|
|
3
5
|
|
|
4
6
|
class ImageHandlerGeneric(AbstractImageHandler):
|
|
@@ -9,8 +11,11 @@ class ImageHandlerGeneric(AbstractImageHandler):
|
|
|
9
11
|
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
10
12
|
raise NotImplementedError()
|
|
11
13
|
|
|
12
|
-
def tag_to_version(self,image_name:str,
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
15
|
+
raise NotImplementedError()
|
|
16
|
+
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
13
18
|
raise NotImplementedError()
|
|
14
19
|
|
|
15
|
-
def
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
16
21
|
raise NotImplementedError()
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
2
4
|
from ..AbstractImageHandler import AbstractImageHandler
|
|
3
5
|
|
|
4
6
|
class ImageHandlerGenericV(AbstractImageHandler):
|
|
@@ -9,8 +11,11 @@ class ImageHandlerGenericV(AbstractImageHandler):
|
|
|
9
11
|
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
10
12
|
raise NotImplementedError()
|
|
11
13
|
|
|
12
|
-
def tag_to_version(self,image_name:str,
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
15
|
+
raise NotImplementedError()
|
|
16
|
+
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
13
18
|
raise NotImplementedError()
|
|
14
19
|
|
|
15
|
-
def
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
16
21
|
raise NotImplementedError()
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.build.lib.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
4
|
+
from ..AbstractImageHandler import AbstractImageHandler
|
|
5
|
+
|
|
6
|
+
class ImageHandlerGitlabCE(AbstractImageHandler):
|
|
7
|
+
|
|
8
|
+
def can_handle(self,image_name:str)->bool:
|
|
9
|
+
raise NotImplementedError()#TODO
|
|
10
|
+
|
|
11
|
+
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
12
|
+
raise NotImplementedError()
|
|
13
|
+
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
15
|
+
raise NotImplementedError()
|
|
16
|
+
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
18
|
+
raise NotImplementedError()
|
|
19
|
+
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
21
|
+
return VersionEcholon.CustomAlgorithm
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
from packaging.version import Version
|
|
2
|
+
|
|
3
|
+
from ScriptCollection.ScriptCollection.GeneralUtilities import VersionEcholon
|
|
4
|
+
from ..AbstractImageHandler import AbstractImageHandler
|
|
5
|
+
|
|
6
|
+
class ImageHandlerGitlabEE(AbstractImageHandler):
|
|
7
|
+
|
|
8
|
+
def can_handle(self,image_name:str)->bool:
|
|
9
|
+
raise NotImplementedError()#TODO
|
|
10
|
+
|
|
11
|
+
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
12
|
+
raise NotImplementedError()
|
|
13
|
+
|
|
14
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
15
|
+
raise NotImplementedError()
|
|
16
|
+
|
|
17
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
18
|
+
raise NotImplementedError()
|
|
19
|
+
|
|
20
|
+
def get_default_echolon_for_update(self,image_name:str)->VersionEcholon:
|
|
21
|
+
return VersionEcholon.CustomAlgorithm
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from unittest import result
|
|
2
3
|
from packaging.version import Version
|
|
3
4
|
from ..GeneralUtilities import GeneralUtilities
|
|
4
5
|
from ..ScriptCollectionCore import ScriptCollectionCore
|
|
5
6
|
from ..GeneralUtilities import VersionEcholon
|
|
7
|
+
from ..SCLog import LogLevel
|
|
6
8
|
from .AbstractImageHandler import AbstractImageHandler
|
|
9
|
+
from .ConcreteImageHandlers.ImageHandlerDebian import ImageHandlerDebian
|
|
7
10
|
from .ConcreteImageHandlers.ImageHandlerDebianSlim import ImageHandlerDebianSlim
|
|
11
|
+
from .ConcreteImageHandlers.ImageHandlerGeneric import ImageHandlerGeneric
|
|
12
|
+
from .ConcreteImageHandlers.ImageHandlerGenericV import ImageHandlerGenericV
|
|
13
|
+
from .ConcreteImageHandlers.ImageHandlerGitlabCE import ImageHandlerGitlabCE
|
|
14
|
+
from .ConcreteImageHandlers.ImageHandlerGitlabEE import ImageHandlerGitlabEE
|
|
8
15
|
|
|
9
16
|
class OCIImageManager:
|
|
10
17
|
|
|
@@ -15,8 +22,14 @@ class OCIImageManager:
|
|
|
15
22
|
if sc is None:
|
|
16
23
|
sc=ScriptCollectionCore()
|
|
17
24
|
self.__sc=sc
|
|
18
|
-
self.image_handler=[
|
|
19
|
-
|
|
25
|
+
self.image_handler=[
|
|
26
|
+
ImageHandlerDebian(),
|
|
27
|
+
ImageHandlerDebianSlim(),
|
|
28
|
+
ImageHandlerGeneric(),
|
|
29
|
+
ImageHandlerGenericV(),
|
|
30
|
+
ImageHandlerGitlabCE(),
|
|
31
|
+
ImageHandlerGitlabEE(),
|
|
32
|
+
]
|
|
20
33
|
|
|
21
34
|
def get_image_handler(self,image_name:str)->AbstractImageHandler:
|
|
22
35
|
for image_handler in self.image_handler:
|
|
@@ -87,23 +100,80 @@ class OCIImageManager:
|
|
|
87
100
|
def get_registry_address_for_image_with_default_tag(self,repository:str,image_name:str,strict_mode:bool=True)->str:
|
|
88
101
|
return f"{self.get_registry_address_for_image(repository,image_name)}:{self.get_tag_for_image(repository,image_name,strict_mode)}"
|
|
89
102
|
|
|
90
|
-
def
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
def update_default_tag_for_images_in_image_definitions_file(self,repository:str,search_in_custom_registry_only_if_available:bool)->None:
|
|
104
|
+
file=f"{repository}/.ScriptCollection/OCIImages/ImageDefinition.csv"
|
|
105
|
+
GeneralUtilities.assert_file_exists(file)
|
|
106
|
+
lines=GeneralUtilities.read_nonempty_lines_from_file(file)
|
|
107
|
+
new_lines:list[str]=[]
|
|
108
|
+
#file looks like:
|
|
109
|
+
#ImageName;UpstreamRegistryAddress;DefaultTag
|
|
110
|
+
#Debian;docker.io/library/debian;13.4-slim
|
|
111
|
+
for line in lines:
|
|
112
|
+
if line.startswith("ImageName;"): #header line
|
|
113
|
+
new_lines.append(line)
|
|
114
|
+
continue
|
|
115
|
+
splitted_line=line.split(";")
|
|
116
|
+
image_name=splitted_line[0]
|
|
117
|
+
registry_address=splitted_line[1]
|
|
118
|
+
default_tag=splitted_line[2]
|
|
119
|
+
tag=default_tag
|
|
120
|
+
try:
|
|
121
|
+
addresses_to_check=[]
|
|
122
|
+
if self.custom_registry_is_defined(image_name):
|
|
123
|
+
addresses_to_check.append(self.get_registry_address_for_image(repository,image_name))
|
|
124
|
+
else:
|
|
125
|
+
if search_in_custom_registry_only_if_available:
|
|
126
|
+
raise ValueError(f"No custom registry defined for image {image_name}.")
|
|
127
|
+
if not search_in_custom_registry_only_if_available:
|
|
128
|
+
addresses_to_check.append(registry_address)
|
|
129
|
+
newest_versions:set[Version]=[default_tag]
|
|
130
|
+
current_version=Version(default_tag)
|
|
131
|
+
for address in addresses_to_check:
|
|
132
|
+
newest_versions_for_address=self.get_available_versions_of_image_which_are_newer(image_name,address,current_version,VersionEcholon.LatestVersion)
|
|
133
|
+
if newest_versions_for_address is not None:
|
|
134
|
+
newest_versions.update(newest_versions_for_address)
|
|
135
|
+
GeneralUtilities.assert_condition(len(newest_versions)>0,f"Could not find any version for image {image_name} in registry {registry_address}.")
|
|
136
|
+
newest_version=max(newest_versions)
|
|
137
|
+
tag=self.version_to_tag(image_name,newest_version)
|
|
138
|
+
except Exception as e:
|
|
139
|
+
self.__sc.log.log(f"Could not get tag for image {image_name} from registry {registry_address}. Reason: {str(e)}",LogLevel.Warning)
|
|
140
|
+
new_lines.append(f"{image_name};{registry_address};{tag}")
|
|
141
|
+
GeneralUtilities.write_lines_to_file(file,new_lines)
|
|
95
142
|
|
|
143
|
+
def get_available_versions_of_image_which_are_newer(self,image_name:str,registry_address:str,current_version:Version,echolon: VersionEcholon)->Version:
|
|
144
|
+
image_handler=self.get_image_handler(image_name)
|
|
145
|
+
result= None #TODO calculate result using get_available_tags_of_image.
|
|
146
|
+
#TODO if echolon is not none, then use echolon instead of the default echolon of the image-handler.
|
|
147
|
+
#TODO return the versions sorted.
|
|
148
|
+
#TODO if result is empty: return None
|
|
149
|
+
return result
|
|
150
|
+
|
|
96
151
|
def get_available_tags_of_image(self,image_name:str,registry_address:str)->list[str]:
|
|
97
152
|
"""registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian".
|
|
98
153
|
returns something like ["13.2-slim", "13.2", "13.3-slim", "13.3"]."""
|
|
99
154
|
return self.get_image_handler(image_name).get_available_tags_of_image(image_name,registry_address)
|
|
100
155
|
|
|
101
|
-
def tag_to_version(self,image_name:str,
|
|
156
|
+
def tag_to_version(self,image_name:str,tag:str)->Version:
|
|
102
157
|
"""registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian"."""
|
|
103
|
-
return self.get_image_handler(image_name).tag_to_version(image_name,
|
|
158
|
+
return self.get_image_handler(image_name).tag_to_version(image_name, tag)
|
|
104
159
|
|
|
105
|
-
def version_to_tag(self,image_name:str,
|
|
160
|
+
def version_to_tag(self,image_name:str,version:Version)->str:
|
|
106
161
|
"""registry_address must have one of theese formats: "myregistry.example.com/debian" or "docker.io/debian" or "docker.io/myuser/debian".
|
|
107
162
|
returns something like "13.3-slim".
|
|
108
163
|
If there are multiple tags available for a certain version then the image-handler decides which one will be returned."""
|
|
109
|
-
return self.get_image_handler(image_name).version_to_tag(image_name,
|
|
164
|
+
return self.get_image_handler(image_name).version_to_tag(image_name,version)
|
|
165
|
+
|
|
166
|
+
def get_images_used_in_docker_compose_file(self,docker_compose_file:str)->dict[str,tuple[str,str,str]]:#returns dict[service_name,[image_name,image_address,current_tag]]
|
|
167
|
+
GeneralUtilities.assert_file_exists(docker_compose_file)
|
|
168
|
+
return {}#TODO implement function
|
|
169
|
+
|
|
170
|
+
def update_image_in_docker_compose_file(self,docker_compose_file:str)->None:
|
|
171
|
+
for service,service_information in self.get_images_used_in_docker_compose_file(docker_compose_file).items():
|
|
172
|
+
image_name=service_information[0]
|
|
173
|
+
image_address=service_information[1]
|
|
174
|
+
current_tag=service_information[2]
|
|
175
|
+
image_handler=self.get_image_handler(image_name)
|
|
176
|
+
new_versions_for_address=self.get_available_versions_of_image_which_are_newer(image_name,image_address,self.tag_to_version(image_name,current_tag),image_handler.get_default_echolon_for_update())
|
|
177
|
+
new_tag=self.version_to_tag(image_name,new_versions_for_address)
|
|
178
|
+
#TODO update tag for service in docker-compose-file to new_tag
|
|
179
|
+
|
|
@@ -38,7 +38,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
38
38
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
39
39
|
from .SCLog import SCLog, LogLevel
|
|
40
40
|
|
|
41
|
-
version = "4.2.
|
|
41
|
+
version = "4.2.79"
|
|
42
42
|
__version__ = version
|
|
43
43
|
|
|
44
44
|
class VSCodeWorkspaceShellTask:
|
|
@@ -1998,6 +1998,12 @@ class ScriptCollectionCore:
|
|
|
1998
1998
|
return self.program_runner.run_program(program, arguments, working_directory, custom_argument, interactive)
|
|
1999
1999
|
return self.run_program_argsasarray(program, GeneralUtilities.arguments_to_array(arguments), working_directory, print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace, GeneralUtilities.arguments_to_array(arguments_for_log), throw_exception_if_exitcode_is_not_zero, custom_argument, interactive, print_live_output)
|
|
2000
2000
|
|
|
2001
|
+
# Return-values program_runner: Exitcode, StdOut, StdErr, Pid
|
|
2002
|
+
@GeneralUtilities.check_arguments
|
|
2003
|
+
def run_program_argsasarray_with_retry(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, throw_exception_if_exitcode_is_not_zero: bool = True, custom_argument: object = None, interactive: bool = False, print_live_output: bool = False, amount_of_attempts: int = 5, delay_in_seconds: int = 2) -> tuple[int, str, str, int]:
|
|
2004
|
+
return GeneralUtilities.retry_action(lambda: self.run_program_argsasarray(program, arguments_as_array, working_directory, print_errors_as_information, log_file, timeoutInSeconds, addLogOverhead, title, log_namespace,arguments_for_log, throw_exception_if_exitcode_is_not_zero, custom_argument, interactive, print_live_output), amount_of_attempts, delay_in_seconds=delay_in_seconds)
|
|
2005
|
+
|
|
2006
|
+
|
|
2001
2007
|
# Return-values program_runner: Pid
|
|
2002
2008
|
@GeneralUtilities.check_arguments
|
|
2003
2009
|
def run_program_argsasarray_async(self, program: str, arguments_as_array: list[str] = [], working_directory: str = None, print_errors_as_information: bool = False, log_file: str = None, timeoutInSeconds: int = 600, addLogOverhead: bool = False, title: str = None, log_namespace: str = "", arguments_for_log: list[str] = None, custom_argument: object = None, interactive: bool = False) -> int:
|
|
@@ -2635,15 +2641,8 @@ TXDX
|
|
|
2635
2641
|
trim_texts(child)
|
|
2636
2642
|
trim_texts(element)
|
|
2637
2643
|
ET.indent(element)
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
ET.tostring(
|
|
2641
|
-
element,
|
|
2642
|
-
xml_declaration=add_xml_declaration,
|
|
2643
|
-
encoding="unicode"
|
|
2644
|
-
),
|
|
2645
|
-
encoding
|
|
2646
|
-
)
|
|
2644
|
+
content = ET.tostring(element, xml_declaration=add_xml_declaration, encoding="unicode")
|
|
2645
|
+
GeneralUtilities.write_text_to_file(file, content.rstrip("\n") + "\n", encoding)
|
|
2647
2646
|
|
|
2648
2647
|
@GeneralUtilities.check_arguments
|
|
2649
2648
|
def format_html_file(self, file: str, add_html_declaration: bool = False) -> None:
|
|
@@ -2715,8 +2714,16 @@ TXDX
|
|
|
2715
2714
|
def handle_pi(self, data):
|
|
2716
2715
|
self._top().children.append(_Node(raw=f"<?{data}>"))
|
|
2717
2716
|
|
|
2717
|
+
_angular_exprs: list[str] = []
|
|
2718
|
+
|
|
2719
|
+
def _protect_angular(m: re.Match) -> str:
|
|
2720
|
+
idx = len(_angular_exprs)
|
|
2721
|
+
_angular_exprs.append(m.group(0))
|
|
2722
|
+
return f"__ANGEXPR{idx}__"
|
|
2723
|
+
|
|
2724
|
+
protected = re.sub(r'\{\{[\s\S]*?\}\}', _protect_angular, content)
|
|
2718
2725
|
builder = _Builder()
|
|
2719
|
-
builder.feed(
|
|
2726
|
+
builder.feed(protected)
|
|
2720
2727
|
ind = " "
|
|
2721
2728
|
|
|
2722
2729
|
def _serialize(node: _Node, depth: int) -> list:
|
|
@@ -2747,7 +2754,9 @@ TXDX
|
|
|
2747
2754
|
lines.append(f"{prefix}</{node.tag}>")
|
|
2748
2755
|
return lines
|
|
2749
2756
|
|
|
2750
|
-
result = "\n".join(_serialize(builder.root, 0))
|
|
2757
|
+
result = "\n".join(line for line in _serialize(builder.root, 0) if line.strip())
|
|
2758
|
+
for i, expr in enumerate(_angular_exprs):
|
|
2759
|
+
result = result.replace(f"__ANGEXPR{i}__", expr)
|
|
2751
2760
|
if add_html_declaration and not result.lstrip().startswith("<!DOCTYPE"):
|
|
2752
2761
|
result = "<!DOCTYPE html>\n" + result
|
|
2753
2762
|
return result
|
|
@@ -13,7 +13,6 @@ class TFCPS_CodeUnitSpecific_Docker_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
13
13
|
def __init__(self,current_file:str,verbosity:LogLevel,targetenvironmenttype:str,use_cache:bool,is_pre_merge:bool):
|
|
14
14
|
super().__init__(current_file, verbosity,targetenvironmenttype,use_cache,is_pre_merge)
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
@GeneralUtilities.check_arguments
|
|
18
17
|
def build(self,platforms:list[Platform],custom_arguments:dict[str,str]) -> None:
|
|
19
18
|
codeunitname: str =self.get_codeunit_name()
|
|
@@ -43,7 +42,9 @@ class TFCPS_CodeUnitSpecific_Docker_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
43
42
|
args.append("--output")
|
|
44
43
|
args.append(f"type=docker,dest={target_file}")
|
|
45
44
|
args.append(".")
|
|
46
|
-
|
|
45
|
+
time.sleep(5)
|
|
46
|
+
self._protected_sc.run_program_argsasarray_with_retry("docker", args, codeunit_folder, print_errors_as_information=True,print_live_output=self.get_verbosity()==LogLevel.Debug,amount_of_attempts=3,delay_in_seconds=5)
|
|
47
|
+
time.sleep(2)
|
|
47
48
|
self._protected_sc.run_program_argsasarray("docker", ["load", "-i", target_file], codeunit_folder, print_errors_as_information=True,print_live_output=self.get_verbosity()==LogLevel.Debug)
|
|
48
49
|
|
|
49
50
|
self.__generate_sbom_for_docker_image()
|
|
@@ -191,9 +191,51 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
191
191
|
os.rename(f"{codeunit_folder}\\{bomfile_folder}\\bom.xml", target)
|
|
192
192
|
self._protected_sc.format_xml_file(target)
|
|
193
193
|
|
|
194
|
+
@GeneralUtilities.check_arguments
|
|
195
|
+
def get_dotnet_build_diagnostics(self) -> list[tuple[LogLevel, str, str | None, int | None]]:
|
|
196
|
+
codeunit_name = self.get_codeunit_name()
|
|
197
|
+
codeunit_folder = self.get_codeunit_folder()
|
|
198
|
+
sln_file = os.path.join(codeunit_folder, codeunit_name + ".sln")
|
|
199
|
+
temp_output_folder = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
|
|
200
|
+
GeneralUtilities.ensure_directory_exists(temp_output_folder)
|
|
201
|
+
try:
|
|
202
|
+
run_result = self._protected_sc.run_program("dotnet", f"build \"{sln_file}\" -nologo -v minimal -o \"{temp_output_folder}\"", codeunit_folder, throw_exception_if_exitcode_is_not_zero=False)
|
|
203
|
+
finally:
|
|
204
|
+
GeneralUtilities.ensure_directory_does_not_exist(temp_output_folder)
|
|
205
|
+
diagnostics: list[tuple[LogLevel, str, str | None, int | None]] = []
|
|
206
|
+
pattern = re.compile(r"^\s*(?:(.+?)\((\d+),\d+\): )?(error|warning|message|info) [^:]+: (.+?)(?:\s*\[.+\])?\s*$", re.IGNORECASE)
|
|
207
|
+
for line in GeneralUtilities.string_to_lines(run_result[1] + "\n" + run_result[2]):
|
|
208
|
+
m = pattern.match(line)
|
|
209
|
+
if m:
|
|
210
|
+
file_path = m.group(1)
|
|
211
|
+
line_number = int(m.group(2)) if m.group(2) else None
|
|
212
|
+
level_str = m.group(3).lower()
|
|
213
|
+
message = m.group(4)
|
|
214
|
+
if level_str == "error":
|
|
215
|
+
level = LogLevel.Error
|
|
216
|
+
elif level_str == "warning":
|
|
217
|
+
level = LogLevel.Warning
|
|
218
|
+
else:
|
|
219
|
+
level = LogLevel.Information
|
|
220
|
+
diagnostics.append((level, message, file_path, line_number))
|
|
221
|
+
return diagnostics
|
|
222
|
+
|
|
194
223
|
@GeneralUtilities.check_arguments
|
|
195
224
|
def linting(self) -> None:
|
|
196
|
-
|
|
225
|
+
codeunit_name = self.get_codeunit_name()
|
|
226
|
+
codeunit_folder = self.get_codeunit_folder()
|
|
227
|
+
self._protected_sc.format_xml_file(os.path.join(codeunit_folder, codeunit_name, codeunit_name + ".csproj"), add_xml_declaration=False)
|
|
228
|
+
self._protected_sc.format_xml_file(os.path.join(codeunit_folder, codeunit_name + "Tests", codeunit_name + "Tests.csproj"), add_xml_declaration=False)
|
|
229
|
+
self.standardized_task_verify_standard_format_csproj_files()
|
|
230
|
+
diagnostics = self.get_dotnet_build_diagnostics()
|
|
231
|
+
has_errors = False
|
|
232
|
+
for (level, message, file, line) in diagnostics:
|
|
233
|
+
location = f" ({file}:{line})" if file else ""
|
|
234
|
+
self._protected_sc.log.log(f"{message}{location}", level)
|
|
235
|
+
if level == LogLevel.Error:#should not occurr on scbuildcodeunits because then the build would have failed already.
|
|
236
|
+
has_errors = True
|
|
237
|
+
if has_errors:
|
|
238
|
+
raise ValueError("Linting-issues occurred.")
|
|
197
239
|
|
|
198
240
|
@GeneralUtilities.check_arguments
|
|
199
241
|
def do_common_tasks(self,current_codeunit_version:str,certificateGeneratorInformation:CertificateGeneratorInformationBase)-> None:
|
|
@@ -207,7 +249,6 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
207
249
|
self._protected_sc.replace_version_in_nuspec_file(GeneralUtilities.resolve_relative_path(f"./Build/{codeunit_name}.nuspec", folder_of_current_file), codeunit_version)
|
|
208
250
|
if certificateGeneratorInformation.generate_certificate():
|
|
209
251
|
self.tfcps_Tools_General.set_constants_for_certificate_private_information(self.get_codeunit_folder())
|
|
210
|
-
self.standardized_task_verify_standard_format_csproj_files()
|
|
211
252
|
|
|
212
253
|
@GeneralUtilities.check_arguments
|
|
213
254
|
def standardized_task_verify_standard_format_csproj_files(self) -> bool:
|
|
@@ -237,64 +278,64 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
237
278
|
codeunit_version_regex = re.escape(codeunit_version)
|
|
238
279
|
codeunit_description_regex = re.escape(codeunit_description)
|
|
239
280
|
regex = f"""^<Project Sdk=\\"Microsoft\\.NET\\.Sdk\\">
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
<\\/Project
|
|
281
|
+
<PropertyGroup>
|
|
282
|
+
<TargetFramework>([^<]+)<\\/TargetFramework>
|
|
283
|
+
<Authors>([^<]+)<\\/Authors>
|
|
284
|
+
<Version>{codeunit_version_regex}<\\/Version>
|
|
285
|
+
<AssemblyVersion>{codeunit_version_regex}<\\/AssemblyVersion>
|
|
286
|
+
<FileVersion>{codeunit_version_regex}<\\/FileVersion>
|
|
287
|
+
<SelfContained>false<\\/SelfContained>
|
|
288
|
+
<IsPackable>false<\\/IsPackable>
|
|
289
|
+
<PreserveCompilationContext>false<\\/PreserveCompilationContext>
|
|
290
|
+
<GenerateRuntimeConfigurationFiles>true<\\/GenerateRuntimeConfigurationFiles>
|
|
291
|
+
<Copyright>([^<]+)<\\/Copyright>
|
|
292
|
+
<Description>{codeunit_description_regex}<\\/Description>
|
|
293
|
+
<PackageProjectUrl>https:\\/\\/([^<]+)<\\/PackageProjectUrl>
|
|
294
|
+
<RepositoryUrl>https:\\/\\/([^<]+)\\.git<\\/RepositoryUrl>
|
|
295
|
+
<RootNamespace>([^<]+)\\.Core<\\/RootNamespace>
|
|
296
|
+
<ProduceReferenceAssembly>false<\\/ProduceReferenceAssembly>
|
|
297
|
+
<Nullable>(disable|enable|warnings|annotations)<\\/Nullable>
|
|
298
|
+
<Configurations>Development;QualityCheck;Productive<\\/Configurations>
|
|
299
|
+
<IsTestProject>false<\\/IsTestProject>
|
|
300
|
+
<LangVersion>([^<]+)<\\/LangVersion>
|
|
301
|
+
<PackageRequireLicenseAcceptance>true<\\/PackageRequireLicenseAcceptance>
|
|
302
|
+
<GenerateSerializationAssemblies>Off<\\/GenerateSerializationAssemblies>
|
|
303
|
+
<AppendTargetFrameworkToOutputPath>false<\\/AppendTargetFrameworkToOutputPath>
|
|
304
|
+
<OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResult_DotNet_win\\-x64<\\/OutputPath>
|
|
305
|
+
<PlatformTarget>([^<]+)<\\/PlatformTarget>
|
|
306
|
+
<WarningLevel>\\d<\\/WarningLevel>
|
|
307
|
+
<Prefer32Bit>false<\\/Prefer32Bit>
|
|
308
|
+
<SignAssembly>true<\\/SignAssembly>
|
|
309
|
+
<AssemblyOriginatorKeyFile>\\.\\.\\\\\\.\\.\\\\Other\\\\Resources\\\\PublicKeys\\\\StronglyNamedKey\\\\([^<]+)PublicKey\\.snk<\\/AssemblyOriginatorKeyFile>
|
|
310
|
+
<DelaySign>true<\\/DelaySign>
|
|
311
|
+
<NoWarn>([^<]+)<\\/NoWarn>
|
|
312
|
+
<WarningsAsErrors>([^<]+)<\\/WarningsAsErrors>
|
|
313
|
+
<ErrorLog>\\.\\.\\\\Other\\\\Resources\\\\CodeAnalysisResult\\\\{codeunit_name_regex}\\.sarif<\\/ErrorLog>
|
|
314
|
+
<OutputType>([^<]+)<\\/OutputType>
|
|
315
|
+
<DocumentationFile>\\.\\.\\\\Other\\\\Artifacts\\\\MetaInformation\\\\{codeunit_name_regex}\\.xml<\\/DocumentationFile>(\\n|.)*
|
|
316
|
+
<\\/PropertyGroup>
|
|
317
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Development'\\\">
|
|
318
|
+
<DebugType>full<\\/DebugType>
|
|
319
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
320
|
+
<Optimize>false<\\/Optimize>
|
|
321
|
+
<DefineConstants>TRACE;DEBUG;Development<\\/DefineConstants>
|
|
322
|
+
<ErrorReport>prompt<\\/ErrorReport>
|
|
323
|
+
<\\/PropertyGroup>
|
|
324
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='QualityCheck'\\\">
|
|
325
|
+
<DebugType>portable<\\/DebugType>
|
|
326
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
327
|
+
<Optimize>false<\\/Optimize>
|
|
328
|
+
<DefineConstants>TRACE;QualityCheck<\\/DefineConstants>
|
|
329
|
+
<ErrorReport>none<\\/ErrorReport>
|
|
330
|
+
<\\/PropertyGroup>
|
|
331
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Productive'\\\">
|
|
332
|
+
<DebugType>portable<\\/DebugType>
|
|
333
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
334
|
+
<Optimize>false<\\/Optimize>
|
|
335
|
+
<DefineConstants>Productive<\\/DefineConstants>
|
|
336
|
+
<ErrorReport>none<\\/ErrorReport>
|
|
337
|
+
<\\/PropertyGroup>(\\n|.)*
|
|
338
|
+
<\\/Project>\\n?$"""
|
|
298
339
|
result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
|
|
299
340
|
return (result[0], regex, result[1])
|
|
300
341
|
|
|
@@ -302,63 +343,63 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
302
343
|
codeunit_name_regex = re.escape(codeunit_name)
|
|
303
344
|
codeunit_version_regex = re.escape(codeunit_version)
|
|
304
345
|
regex = f"""^<Project Sdk=\\"Microsoft\\.NET\\.Sdk\\">
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
<\\/Project
|
|
346
|
+
<PropertyGroup>
|
|
347
|
+
<TargetFramework>([^<]+)<\\/TargetFramework>
|
|
348
|
+
<Authors>([^<]+)<\\/Authors>
|
|
349
|
+
<Version>{codeunit_version_regex}<\\/Version>
|
|
350
|
+
<AssemblyVersion>{codeunit_version_regex}<\\/AssemblyVersion>
|
|
351
|
+
<FileVersion>{codeunit_version_regex}<\\/FileVersion>
|
|
352
|
+
<SelfContained>false<\\/SelfContained>
|
|
353
|
+
<IsPackable>false<\\/IsPackable>
|
|
354
|
+
<PreserveCompilationContext>false<\\/PreserveCompilationContext>
|
|
355
|
+
<GenerateRuntimeConfigurationFiles>true<\\/GenerateRuntimeConfigurationFiles>
|
|
356
|
+
<Copyright>([^<]+)<\\/Copyright>
|
|
357
|
+
<Description>{codeunit_name_regex}Tests is the test-project for {codeunit_name_regex}\\.<\\/Description>
|
|
358
|
+
<PackageProjectUrl>https:\\/\\/([^<]+)<\\/PackageProjectUrl>
|
|
359
|
+
<RepositoryUrl>https:\\/\\/([^<]+)\\.git</RepositoryUrl>
|
|
360
|
+
<RootNamespace>([^<]+)\\.Tests<\\/RootNamespace>
|
|
361
|
+
<ProduceReferenceAssembly>false<\\/ProduceReferenceAssembly>
|
|
362
|
+
<Nullable>(disable|enable|warnings|annotations)<\\/Nullable>
|
|
363
|
+
<Configurations>Development;QualityCheck;Productive<\\/Configurations>
|
|
364
|
+
<IsTestProject>true<\\/IsTestProject>
|
|
365
|
+
<LangVersion>([^<]+)<\\/LangVersion>
|
|
366
|
+
<PackageRequireLicenseAcceptance>true<\\/PackageRequireLicenseAcceptance>
|
|
367
|
+
<GenerateSerializationAssemblies>Off<\\/GenerateSerializationAssemblies>
|
|
368
|
+
<AppendTargetFrameworkToOutputPath>false<\\/AppendTargetFrameworkToOutputPath>
|
|
369
|
+
<OutputPath>\\.\\.\\\\Other\\\\Artifacts\\\\BuildResultTests_DotNet_win\\-x64<\\/OutputPath>
|
|
370
|
+
<PlatformTarget>([^<]+)<\\/PlatformTarget>
|
|
371
|
+
<WarningLevel>\\d<\\/WarningLevel>
|
|
372
|
+
<Prefer32Bit>false<\\/Prefer32Bit>
|
|
373
|
+
<SignAssembly>true<\\/SignAssembly>
|
|
374
|
+
<AssemblyOriginatorKeyFile>\\.\\.\\\\\\.\\.\\\\Other\\\\Resources\\\\PublicKeys\\\\StronglyNamedKey\\\\([^<]+)PublicKey\\.snk<\\/AssemblyOriginatorKeyFile>
|
|
375
|
+
<DelaySign>true<\\/DelaySign>
|
|
376
|
+
<NoWarn>([^<]+)<\\/NoWarn>
|
|
377
|
+
<WarningsAsErrors>([^<]+)<\\/WarningsAsErrors>
|
|
378
|
+
<ErrorLog>\\.\\.\\\\Other\\\\Resources\\\\CodeAnalysisResult\\\\{codeunit_name_regex}Tests\\.sarif<\\/ErrorLog>
|
|
379
|
+
<OutputType>Library<\\/OutputType>(\\n|.)*
|
|
380
|
+
<\\/PropertyGroup>
|
|
381
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Development'\\\">
|
|
382
|
+
<DebugType>full<\\/DebugType>
|
|
383
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
384
|
+
<Optimize>false<\\/Optimize>
|
|
385
|
+
<DefineConstants>TRACE;DEBUG;Development<\\/DefineConstants>
|
|
386
|
+
<ErrorReport>prompt<\\/ErrorReport>
|
|
387
|
+
<\\/PropertyGroup>
|
|
388
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='QualityCheck'\\\">
|
|
389
|
+
<DebugType>portable<\\/DebugType>
|
|
390
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
391
|
+
<Optimize>false<\\/Optimize>
|
|
392
|
+
<DefineConstants>TRACE;QualityCheck<\\/DefineConstants>
|
|
393
|
+
<ErrorReport>none<\\/ErrorReport>
|
|
394
|
+
<\\/PropertyGroup>
|
|
395
|
+
<PropertyGroup Condition=\\\"'\\$\\(Configuration\\)'=='Productive'\\\">
|
|
396
|
+
<DebugType>portable<\\/DebugType>
|
|
397
|
+
<DebugSymbols>true<\\/DebugSymbols>
|
|
398
|
+
<Optimize>false<\\/Optimize>
|
|
399
|
+
<DefineConstants>Productive<\\/DefineConstants>
|
|
400
|
+
<ErrorReport>none<\\/ErrorReport>
|
|
401
|
+
<\\/PropertyGroup>(\\n|.)*
|
|
402
|
+
<\\/Project>\\n?$"""
|
|
362
403
|
result = self.__standardized_task_verify_standard_format_for_csproj_files(regex, csproj_file)
|
|
363
404
|
return (result[0], regex, result[1])
|
|
364
405
|
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from ...GeneralUtilities import GeneralUtilities
|
|
3
|
+
from ...SCLog import LogLevel
|
|
4
|
+
from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base, TFCPS_CodeUnitSpecific_Base_CLI
|
|
5
|
+
|
|
6
|
+
class TFCPS_CodeUnitSpecific_Maven_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
7
|
+
|
|
8
|
+
def __init__(self, current_file: str, verbosity: LogLevel, targetenvironmenttype: str, use_cache: bool, is_pre_merge: bool):
|
|
9
|
+
super().__init__(current_file, verbosity, targetenvironmenttype, use_cache, is_pre_merge)
|
|
10
|
+
|
|
11
|
+
@GeneralUtilities.check_arguments
|
|
12
|
+
def build(self) -> None:
|
|
13
|
+
pass#TODO
|
|
14
|
+
|
|
15
|
+
@GeneralUtilities.check_arguments
|
|
16
|
+
def linting(self) -> None:
|
|
17
|
+
pass#TODO
|
|
18
|
+
|
|
19
|
+
@GeneralUtilities.check_arguments
|
|
20
|
+
def run_testcases(self) -> None:
|
|
21
|
+
pass#TODO
|
|
22
|
+
|
|
23
|
+
def get_dependencies(self) -> dict[str, set[str]]:
|
|
24
|
+
return dict[str, set[str]]()#TODO
|
|
25
|
+
|
|
26
|
+
@GeneralUtilities.check_arguments
|
|
27
|
+
def get_available_versions(self, dependencyname: str) -> list[str]:
|
|
28
|
+
return []#TODO
|
|
29
|
+
|
|
30
|
+
@GeneralUtilities.check_arguments
|
|
31
|
+
def set_dependency_version(self, name: str, new_version: str) -> None:
|
|
32
|
+
raise ValueError("Operation is not implemented.")
|
|
33
|
+
|
|
34
|
+
class TFCPS_CodeUnitSpecific_Maven_CLI:
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
@GeneralUtilities.check_arguments
|
|
38
|
+
def parse(file: str) -> TFCPS_CodeUnitSpecific_Maven_Functions:
|
|
39
|
+
parser = TFCPS_CodeUnitSpecific_Base_CLI.get_base_parser()
|
|
40
|
+
#add custom parameter if desired
|
|
41
|
+
args = parser.parse_args()
|
|
42
|
+
result: TFCPS_CodeUnitSpecific_Maven_Functions = TFCPS_CodeUnitSpecific_Maven_Functions(file, LogLevel(int(args.verbosity)), args.targetenvironmenttype, not args.nocache, args.ispremerge)
|
|
43
|
+
return result
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from ...GeneralUtilities import GeneralUtilities
|
|
3
|
+
from ...SCLog import LogLevel
|
|
4
|
+
from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base, TFCPS_CodeUnitSpecific_Base_CLI
|
|
5
|
+
|
|
6
|
+
class TFCPS_CodeUnitSpecific_Rust_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
7
|
+
|
|
8
|
+
def __init__(self, current_file: str, verbosity: LogLevel, targetenvironmenttype: str, use_cache: bool, is_pre_merge: bool):
|
|
9
|
+
super().__init__(current_file, verbosity, targetenvironmenttype, use_cache, is_pre_merge)
|
|
10
|
+
|
|
11
|
+
@GeneralUtilities.check_arguments
|
|
12
|
+
def build(self) -> None:
|
|
13
|
+
pass#TODO
|
|
14
|
+
|
|
15
|
+
@GeneralUtilities.check_arguments
|
|
16
|
+
def linting(self) -> None:
|
|
17
|
+
pass#TODO
|
|
18
|
+
|
|
19
|
+
@GeneralUtilities.check_arguments
|
|
20
|
+
def run_testcases(self) -> None:
|
|
21
|
+
pass#TODO
|
|
22
|
+
|
|
23
|
+
def get_dependencies(self) -> dict[str, set[str]]:
|
|
24
|
+
return dict[str, set[str]]()#TODO
|
|
25
|
+
|
|
26
|
+
@GeneralUtilities.check_arguments
|
|
27
|
+
def get_available_versions(self, dependencyname: str) -> list[str]:
|
|
28
|
+
return []#TODO
|
|
29
|
+
|
|
30
|
+
@GeneralUtilities.check_arguments
|
|
31
|
+
def set_dependency_version(self, name: str, new_version: str) -> None:
|
|
32
|
+
raise ValueError("Operation is not implemented.")
|
|
33
|
+
|
|
34
|
+
class TFCPS_CodeUnitSpecific_Rust_CLI:
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
@GeneralUtilities.check_arguments
|
|
38
|
+
def parse(file: str) -> TFCPS_CodeUnitSpecific_Rust_Functions:
|
|
39
|
+
parser = TFCPS_CodeUnitSpecific_Base_CLI.get_base_parser()
|
|
40
|
+
#add custom parameter if desired
|
|
41
|
+
args = parser.parse_args()
|
|
42
|
+
result: TFCPS_CodeUnitSpecific_Rust_Functions = TFCPS_CodeUnitSpecific_Rust_Functions(file, LogLevel(int(args.verbosity)), args.targetenvironmenttype, not args.nocache, args.ispremerge)
|
|
43
|
+
return result
|
|
File without changes
|
|
@@ -1562,4 +1562,4 @@ class TFCPS_Tools_General:
|
|
|
1562
1562
|
|
|
1563
1563
|
|
|
1564
1564
|
def update_dependent_oci_images(self,repo:str):
|
|
1565
|
-
|
|
1565
|
+
self.oci_image_manager.update_default_tag_for_images_in_image_definitions_file(repo,True)
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ScriptCollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.79
|
|
4
4
|
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
5
|
Home-page: https://github.com/anionDev/ScriptCollection
|
|
6
6
|
Author: Marius Göcke
|
|
@@ -22,7 +22,7 @@ Classifier: Topic :: Terminals
|
|
|
22
22
|
Classifier: Topic :: Utilities
|
|
23
23
|
Requires-Python: >=3.10
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
|
-
Requires-Dist: build>=1.
|
|
25
|
+
Requires-Dist: build>=1.5.0
|
|
26
26
|
Requires-Dist: coverage>=7.13.5
|
|
27
27
|
Requires-Dist: cyclonedx-bom>=7.1.0
|
|
28
28
|
Requires-Dist: defusedxml>=0.7.1
|
|
@@ -32,7 +32,7 @@ Requires-Dist: lxml>=6.0.1
|
|
|
32
32
|
Requires-Dist: ntplib>=0.4.0
|
|
33
33
|
Requires-Dist: Pillow>=11.3.0
|
|
34
34
|
Requires-Dist: psutil>=7.2.2
|
|
35
|
-
Requires-Dist: pycdlib>=1.
|
|
35
|
+
Requires-Dist: pycdlib>=1.16.0
|
|
36
36
|
Requires-Dist: Pygments>=2.20.0
|
|
37
37
|
Requires-Dist: pylint>=4.0.5
|
|
38
38
|
Requires-Dist: pyOpenSSL>=25.3.0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
ScriptCollection/AnionBuildPlatform.py,sha256=K-PHarX802A0PU8uRu0GNcEZiXujFoXHACe-X9YJsAQ,11711
|
|
2
2
|
ScriptCollection/CertificateUpdater.py,sha256=Pa6eyjQSx7IIvj4PQVMI0IwMs01KQrNSB7Qa-7lRfBs,9375
|
|
3
|
-
ScriptCollection/Executables.py,sha256=
|
|
4
|
-
ScriptCollection/GeneralUtilities.py,sha256=
|
|
3
|
+
ScriptCollection/Executables.py,sha256=RXEm_fbfO4VuPj-OS0YbRgbUHYL4Xr4PD599kaXINBA,44783
|
|
4
|
+
ScriptCollection/GeneralUtilities.py,sha256=JYcsEad4LA_kdlUVECk21wX8MtOv4AeIbD95_Hco2hk,65522
|
|
5
5
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
6
6
|
ScriptCollection/ProcessesRunner.py,sha256=o5raxIt3lknNPoPrjNzJ2bprRPJ3SnL0rrR7crraD7E,1523
|
|
7
7
|
ScriptCollection/ProgramRunnerBase.py,sha256=4A2eQgSg_rRgQcgSi-LYtUlM-uSQEpS7qFWn0tWt4uo,2171
|
|
@@ -9,15 +9,17 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
|
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=BPY7-ZMIlqT7JOKz8qlB5c0laF2Js-ijzqk09GxZC48,3821
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=_khC3xuTdrPoLluBJZWfldltmmuKltABJPcbjZSFW-4,4835
|
|
11
11
|
ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=a3Y6jKYzMqc33-AaG-MP0erF0kDnYCdCY7fJkP1GX3M,188192
|
|
13
13
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
-
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=
|
|
15
|
-
ScriptCollection/OCIImages/OCIImageManager.py,sha256=
|
|
14
|
+
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
|
|
15
|
+
ScriptCollection/OCIImages/OCIImageManager.py,sha256=awAFVkPifuySPjZ0NGiXeZidAo0D4qoMaHSGFAruq0s,10655
|
|
16
16
|
ScriptCollection/OCIImages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py,sha256=
|
|
18
|
-
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha256=
|
|
19
|
-
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGeneric.py,sha256=
|
|
20
|
-
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGenericV.py,sha256=
|
|
17
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py,sha256=vHWrw_uMflgEleCyh-1cvBQ5mjYZ4gkiVj7r8KcowhA,774
|
|
18
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha256=opzuFLK3tsLcHVm4F5z1mSGl7JHcv7Lz-bvasXRh6eU,768
|
|
19
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGeneric.py,sha256=NgFasra24O-9h_Eoh-25g_nS9d14QNEiySKz6S_6Ul4,765
|
|
20
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGenericV.py,sha256=BdrBuvZVqAh1-FnDAk7c4XEvjpaRbkrSeNZNoRjGK1o,756
|
|
21
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabCE.py,sha256=9MKsoaygz39UEdum0CTTixUt3FM0CY4AQtjays5lWms,780
|
|
22
|
+
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabEE.py,sha256=158aIO7O2CX_QtO4ONHwQnPzFmkN-UQ4FmccKcTUFb4,770
|
|
21
23
|
ScriptCollection/OCIImages/ConcreteImageHandlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
24
|
ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=5-4pwGDq5j1UnpTZy850ZMoxlM9tYPeu781QpZBtCWM,951
|
|
23
25
|
ScriptCollection/Resources/CultureChooser/index.html,sha256=gxQzbrSp4WU52TqN-gcBEtz2gJXmmM14OwTSFtFVRvw,276
|
|
@@ -30,25 +32,31 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=Tpzgiz6m3-cYCkObZOG5Uu7oM-EMoWFzz
|
|
|
30
32
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=-Ev9D3bZDlUk2WFQhcmvzQ3FCS97OdsVUd0koAdmpZc,7474
|
|
31
33
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=Ajfy2pLajTuU6UpwItHt4C2a-gLF3gPc4z6BktL3Cio,22163
|
|
32
34
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
|
|
33
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
35
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=ydRDpWmU-smCphGyTNuaQeiabWaWOUgzIVtuPRoia1s,101274
|
|
34
36
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
|
-
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=
|
|
37
|
+
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=VtaLumyZaoj1jwY1kaym8qmLlzjWZ0jfsc2A1U_Lkpg,12237
|
|
36
38
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
39
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
|
|
38
40
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
|
|
39
41
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
|
|
40
|
-
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=
|
|
42
|
+
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=0Jd-Sik8dY8KMdTsMIpedvYmgsuiyCcoL1VhT5ePQd8,34200
|
|
41
43
|
ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
44
|
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=KAjyFyEjpkghsVPskfsHD68k4Z92gRCT_q6BXfikRwE,7660
|
|
43
45
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
46
|
ScriptCollection/TFCPS/Go/TFCPS_CodeUnitSpecific_Go.py,sha256=kyx26AnT1-LySFA46wfJ9yZUKYdMWTD0U2XZfSQbuB0,3497
|
|
45
47
|
ScriptCollection/TFCPS/Go/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
+
ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py,sha256=nwlofbDhKmFdOZ0Gt8AXqoEl8u-5qfoh9URGYbMJ9C4,1695
|
|
49
|
+
ScriptCollection/TFCPS/Maven/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
50
|
ScriptCollection/TFCPS/NodeJS/TFCPS_CodeUnitSpecific_NodeJS.py,sha256=57I7xbLtCtH-Edt1QKCSXF7wnGyAhbGMdghD_VFZIIY,13184
|
|
47
51
|
ScriptCollection/TFCPS/NodeJS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
52
|
ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=9XK7XnbeOnq_4siVoWovogStoKFiZLhGh3C_f2YaznI,13621
|
|
49
53
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
scriptcollection-4.2.
|
|
54
|
+
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=S_9g9IliQzBBqTQquYj6gI1E3OlGfGZsxXw-mSEe-iA,1690
|
|
55
|
+
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
ScriptCollection/__pycache__/GeneralUtilities.cpython-311.pyc,sha256=vy34znIhp2WBvpxj8Ooll30segB1194IUl_tYi-eO3w,110241
|
|
57
|
+
ScriptCollection/__pycache__/__init__.cpython-311.pyc,sha256=eahP76xKGeVhw7p6P0oYe0ukpe_1L5fkFgXjMBuXPgQ,231
|
|
58
|
+
scriptcollection-4.2.79.dist-info/METADATA,sha256=T7vUDpbYDlP15STaNUMCG5Bx8ZmhhvyO6kzNhDcVyrE,7691
|
|
59
|
+
scriptcollection-4.2.79.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
60
|
+
scriptcollection-4.2.79.dist-info/entry_points.txt,sha256=27XwAJEcaMEc1be0Ec1vKHCbiU4Ziu8jKL-SqsrYOIQ,4680
|
|
61
|
+
scriptcollection-4.2.79.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
62
|
+
scriptcollection-4.2.79.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|