Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 400654d

Browse files
committed
Kotlin: Add latest-url to kotlin_plugin_versions.py
1 parent 6ab86a1 commit 400654d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

java/kotlin-extractor/kotlin_plugin_versions.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import platform
22
import re
33
import subprocess
4+
import sys
45

56
def is_windows():
67
'''Whether we appear to be running on Windows'''
@@ -35,3 +36,19 @@ def get_single_version():
3536
return matching_minor_versions[-1]
3637

3738
raise Exception(f'No suitable kotlinc version found for {current_version} (got {versionOutput}; know about {str(many_versions)})')
39+
40+
def get_latest_url():
41+
version = many_versions[-1]
42+
url = 'https://github.com/JetBrains/kotlin/releases/download/v' + version + '/kotlin-compiler-' + version + '.zip'
43+
return url
44+
45+
if __name__ == "__main__":
46+
args = sys.argv
47+
if len(args) != 2:
48+
raise Exception("Bad arguments")
49+
command = args[1]
50+
if command == 'latest-url':
51+
print(get_latest_url())
52+
else:
53+
raise Exception("Unknown command: " + command)
54+

0 commit comments

Comments
 (0)