Skip to content

Commit 95982d2

Browse files
committed
Fix Kotlin single-version build when the best candidate has trailing version info
For example, 1.7.0-RC would previously be truncated to 1.7.0 resulting in failure to build the single-version distro as all candidate alternate-version kotlin files would be ignored.
1 parent 5abb033 commit 95982d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/kotlin-extractor/kotlin_plugin_versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ def is_windows():
1515
return False
1616

1717
def version_tuple_to_string(version):
18-
return f'{version[0]}.{version[1]}.{version[2]}'
18+
return f'{version[0]}.{version[1]}.{version[2]}{version[3]}'
1919

2020
def version_string_to_tuple(version):
21-
m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', version)
22-
return tuple([int(m.group(i)) for i in range(1, 4)])
21+
m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)(.*)', version)
22+
return tuple([int(m.group(i)) for i in range(1, 4)] + [m.group(4)])
2323

2424
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.21', '1.5.31', '1.6.10', '1.7.0-RC', '1.6.20' ]
2525

0 commit comments

Comments
 (0)