Skip to content

Commit c4e829f

Browse files
authored
Merge pull request github#13385 from igfoo/igfoo/kotlin_version_relax
Kotlin: Relax version requirements
2 parents ccb6223 + ca63122 commit c4e829f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

java/kotlin-extractor/kotlin_plugin_versions.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ def version_string_to_tuple(version):
2424
# Version number used by CI.
2525
ci_version = '1.8.10'
2626

27-
# Version numbers in the list need to be in semantically increasing order
2827
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.20', '1.5.30', '1.6.0', '1.6.20', '1.7.0', '1.7.20', '1.8.0', '1.9.0-Beta' ]
2928

3029
many_versions_tuples = [version_string_to_tuple(v) for v in many_versions]
@@ -42,18 +41,13 @@ def get_single_version(fakeVersionOutput = None):
4241
if m is None:
4342
raise Exception('Cannot detect version of kotlinc (got ' + str(versionOutput) + ')')
4443
current_version = version_string_to_tuple(m.group(1))
45-
matching_minor_versions = [ version for version in many_versions_tuples if version[0:2] == current_version[0:2] ]
46-
if len(matching_minor_versions) == 0:
47-
raise Exception(f'Cannot find a matching minor version for kotlinc version {current_version} (got {versionOutput}; know about {str(many_versions)})')
4844

49-
matching_minor_versions.sort(reverse = True)
45+
many_versions_tuples.sort(reverse = True)
5046

51-
for version in matching_minor_versions:
47+
for version in many_versions_tuples:
5248
if version[0:3] <= current_version[0:3]:
5349
return version_tuple_to_string(version)
5450

55-
return version_tuple_to_string(matching_minor_versions[-1])
56-
5751
raise Exception(f'No suitable kotlinc version found for {current_version} (got {versionOutput}; know about {str(many_versions)})')
5852

5953
def get_latest_url():

0 commit comments

Comments
 (0)