Open jayvdb opened 1 year ago
fwiw, I also have the same problem with https://github.com/kscripting/kscript
$ jgo --additional-endpoints commons-cli:commons-cli org.jetbrains.kotlin:kotlin-scripting-jvm org.jetbrains.kotlin:kotlin-stdlib io.github.kscripting:shell io.github.kscripting:kscript:io.github.kscripting.kscript.KscriptKt linux Foo.kt
[kscript] [ERROR] KOTLIN_HOME is not set and could not be inferred from context.
Quite interestingly, using kotlin-compiler-embeddable
also fails
> jgo --additional-endpoints org.jetbrains.kotlin:kotlin-stdlib org.jetbrains.kotlin:kotlin-compiler-embeddable:org.jetbrains.kotlin.cli.jvm.K2JVMCompiler path/to/script.kt
warning: unable to find kotlin-stdlib.jar in the Kotlin home directory. Pass either '-no-stdlib' to prevent adding it to the classpath, or the correct '-kotlin-home'
...
kscript now works with KOTLIN_HOME
set
jgo --additional-endpoints commons-cli:commons-cli commons-codec:commons-codec io.github.kscripting:shell io.github.kscripting:kscript:io.github.kscripting.kscript.KscriptKt linux tests/expected/print.kt
otherwise the error is
[kscript] [ERROR] KOTLIN_HOME is not set and could not be inferred from context.
The following doesn't work, because there is no (predictable) value which can be used to populate the
-kotlin-home
cli arg. Is there a way we can make this possible ? Some CLI arg substitution that can occur within jgo?