FR: Documentation for Invoking Programmatically
aryeh-looker opened this issue · 1 comments
aryeh-looker commented
Seems to work well with a call to org.jetbrains.kotlinx.ki.shell.KotlinShell.main(args)
aryeh-looker commented
In particular, one can do the following:
- add
ki
as a maven dependency in their project (e.g. which uses gradle, maven, ant, bazel leiningen, etc.); https://mvnrepository.com/artifact/org.jetbrains.kotlinx/ki-shell; e.g. the following if using gradle:
implementation group: 'org.jetbrains.kotlinx', name: 'ki-shell', version: '0.5.2'
- create a main class with something like the following:
import org.jetbrains.kotlinx.ki.shell. KotlinShell
fun main(args: Array<String>) {
KotlinShell.main(*args)
}
- invoke your main class with the classpath set in whichever way is suggested by your build tool (ensuring that the
'org.jetbrains.kotlinx.ki-shell
is on the path as well)