Any reason why kotlin-scripting-jvm-host is the on...
# scripting
j
Any reason why kotlin-scripting-jvm-host is the only scripting related JAR that is not shipped with the compiler release ? (https://github.com/JetBrains/kotlin/releases/tag/v1.3.41). Also, is there an official release for this JAR ? (I know it is available in maven central but I need an "official" release link, if there is any)
l
kotlin scripts use the
kotlinc
binary, you just need to add the
-script
option.
j
That's not what I am asking; I'd like an official release jar from JetBrains so that I can import it in my company repository and use it for experiments.
l
What is preventing you from simply using the
kotlinc
binary? (Sorry, that's what I meant when I wrote
kotlin
, forgot the
c
) I'm not sure how a
jar
would work for the compiler, because kotlin scripts need to be compiled, and that happens with
kotlinc
, not a magic dependency.
j
It's company rule, if I want to use an external jar, I need to submit an official release in our VCS. I was surprised that all jars related to kotlin-scripting are in the compiler distribution but not this one (and I think it might be a mistake)
l
@jdemeulenaere Everything is in
kotlinc
. I just checked by downloading the file
kotlin-compiler-1.3.41.zip
(43.5 MB) from that release page, opened its
bin
directory, created a sample script with
println("Hello World!")
as its code, then running
./kotlinc -script hello\ world.kts
printed the result in the terminal.
javac
is not a
.jar
,
cmake
isn't either, and for
kotlinc
, it's a binary as well. By curiosity though, I looked at the sibling directory named
lib
, and found a file named
kotlin-scripting-compiler.jar
. This is all available in the zip file aforementioned. Nothing seems to be missing.
j
Apologies but I think you are missing the point here. I'm just asking for an official HTTP link to the kotlin-scripting-jvm-host jar (that you can get there : https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-scripting-jvm-host/1.3.41), and I'm also curious on the reason why this jar is not bundled with the 1.3.41 release (all the libs are in the lib/ directory, for instance kotlin-scripting-jvm jar is there).
I know how to use the Kotlin compiler, and I know how to use that jar (given that I could download it from mvnrepository and use that one), I just need the official release jar from jetbrains (for company policy reason)
l
I found this direct download link on the page you linked, under the "Files" button: https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-scripting-jvm-host/1.3.41/kotlin-scripting-jvm-host-1.3.41.jar Its official maven website, in https. Doesn't that satisfy your needs?
If it doesn't, you might want to ask someone from JetBrains here, like Ilya Chernikov.
i
The
kotlinc
release is a distribution of the command-line compiler with standard library, all the other jars there are included because they are needed for the compiler or compiler plugins (including scripting plugin). Jars/libraries that are intended to be used by the user’s applications are officially distributed via Maven Central. The
kotlin-scripting-jvm-host
is exactly one of these, but definitely not the only one of the scripting libs. And it is definitely recommended to use jars from Maven Central, if you are building your apps with scripting.
j
Thanks a lot Ilya! 🙂