lundi 8 octobre 2018

Determine version of Kotlin at runtime

What can be written to determine the version of Kotlin at runtime?

fun main(args : Array<String>) { 
  println("v" + System.getProperty("java.version"))
}

prints a version, but it is the Java JDK version. Using "kotlin.version" prints null. Can this be done at runtime?

If the general answer is no, is there a way to embed this information from the compile phase into a particular function or class?





Aucun commentaire:

Enregistrer un commentaire