1 # Copyright (c) 2023 PANTHEON.tech s.r.o. All rights reserved.
3 # This program and the accompanying materials are made available under the
4 # terms of the Eclipse Public License v1.0 which accompanies this distribution,
5 # and is available at http://www.eclipse.org/legal/epl-v10.html
7 # modify this dir for pick up project from there
11 def find_highest_revision(revisions):
12 # convert list of strings to list of tuples
13 converted_items = [tuple(map(int, item.split('.'))) for item in revisions]
14 biggest_item = max(converted_items, key=lambda x: x)
15 biggest_version = '.'.join(str(x) for x in biggest_item)
16 return biggest_version
19 def log_artifact(path, group_id=None, artifact_id=None, version=None, new_version=None):
21 log += "XML FILE: " + str(path) + "\n"
22 # if none, printing feature update
24 log_line = ("path:", path, "VERSION:", version,
25 "NEW VERSION:", new_version)
26 # else printing artifact update
28 log_line = ("groupId:", group_id.text, "ARTIFACT ID:",
29 artifact_id.text, "VERSION:", version, "NEW VERSION:", new_version)
30 log += str(log_line) + "\n"
31 log += str(100 * "*" + "\n")
35 def check_minor_version(version, new_version):
36 # compares the corresponding elements of the two version strings
37 if any(int(elem_a) != int(elem_b) for elem_a, elem_b in zip(version.text.split("."), new_version.split("."))):