Looking for programatically solutions evaulate `St...
# getting-started
s
Looking for programatically solutions evaulate
String
into Kotlin-code without using
kotlinc
or something existing simmilar. I want use to my project. Better would be a dependency or something.
s
Sounds like you want a Kotlin script engine (JSR-223) - the official example is here: https://github.com/JetBrains/kotlin/tree/master/libraries/examples/kotlin-jsr223-local-example
Still technically in its early stages, so documentation is still sparse
s
Guessing I must figuring out which dependency needs to handle
ScriptEngineManager
injection to using my project.
h
On the terminal you could do
kscript <your_string_with_kotlin_code>
. See https://github.com/holgerbrandl/kscript
s
It is not my option. Lifetime compilation while loading script. That's why I need to control compilation programatically.
But some part of your script would be useful. 🙂
n
maybe thi is what you need https://github.com/s1monw1/KtsRunner
s
that's the looking for