Latest Kotlin version via HTTP


#1

Hi,

I wanted to know if you have any URL where I can programmatically
get the latest Kotlin Version, for Android, like for: ext.kotlin_version = “1.1.2-2”.

Like a list of versions basically.

Other than: https://github.com/JetBrains/kotlin/releases/latest
and parse it.

Thanks!


#2

Usually we update the latest Kotlin version to be displayed on our site here https://github.com/JetBrains/kotlin-web-site/blob/master/data/releases.yml
Though we do not make any commitments that this link will remain functional in the future.

Could you describe why do you need to get such version? Maybe we could offer some alternatives.


#3

I’m trying to add Kotlin support to an Android development tool that I’ve been
working on, so I want to be able to go out and get the latest Kotlin version
automatically when I modify the build.gradle file’s ext.kotlin_version = "1.1.2-2"
when you create a new project.

https://github.com/JetBrains/kotlin/releases/latest works fine, I just wanted to know if you had another way to get it.

With Gradle you can get the latest Android Plugin Version via a JSON string at:
http://search.maven.org/solrsearch/select?q=g:“com.android.tools.build”+AND+a:“gradle”&core=gav&rows=20&wt=json


#4

I think you can use the same approach with querying maven central for artifacts.
We deploy our artifacts to maven central under org.jetbrains.kotlin group, so the query shall look like http://search.maven.org/solrsearch/select?q=g:"org.jetbrains.kotlin"&core=gav&rows=20&wt=json


#5

I’d probably start by seeing what Gradle Versions Plugin does and copy that.


#6

Thanks a lot for the info about your maven central link, I’ll check it out!

Here’s a link to my project:

The Kotlin support for it is working, but using the previous method
to get your Kotlin version number. It supports Android Ant and Gradle projects also.

Thanks!!