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 """Library calls for branch cutting a new stable release."""
9 # modify this dir for pick up project from there
13 def find_highest_revision(revisions):
14 """Return bigger versions in the tuple."""
15 # convert list of strings to list of tuples
16 converted_items = [tuple(map(int, item.split("."))) for item in revisions]
17 biggest_item = max(converted_items, key=lambda x: x)
18 biggest_version = ".".join(str(x) for x in biggest_item)
19 return biggest_version
22 def log_artifact(path, group_id=None, artifact_id=None, version=None, new_version=None):
23 """Add filename and path, artifactId, versions to log."""
25 log += "XML FILE: " + str(path) + "\n"
26 # if none, printing feature update
28 log_line = ("path:", path, "VERSION:", version, "NEW VERSION:", new_version)
29 # else printing artifact update
41 log += str(log_line) + "\n"
42 log += str(100 * "*" + "\n")
46 def check_minor_version(version, new_version):
47 """Take two version string and returns True if its same are the new version."""
48 # compares the corresponding elements of the two version strings
50 int(elem_a) != int(elem_b)
51 for elem_a, elem_b in zip(version.text.split("."), new_version.split("."))