https://kotlinlang.org logo
#scripting
Title
# scripting
v

vineethraj49

01/25/2021, 7:26 AM
this may sound "full-circle", please point me to references on if I can compile a .kts to a jar with all the @file:DependsOn
i

ilya.chernikov

01/25/2021, 12:13 PM
There is no such functionality. And to be honest, composing a fat jar doesn't seem to me like something that compiler need to address. Normally it is done with the external tools. But the jar created with scripting host should normally contain correct
Class-Path
attribute, so it should be not that difficult to pack it with an external tool.
v

vineethraj49

01/25/2021, 7:19 PM
can you point me to such a tool that works with *.main.kts?
i

ilya.chernikov

01/25/2021, 8:17 PM
No, unfortunately I have not investigated them for the task.
h

holgerbrandl

01/28/2021, 12:35 PM
You can do so with kscipt. It allows compiling a script into a self-contained jar.