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

darkmoon_uk

03/26/2024, 8:41 AM
At what point, and why, did KTS files start needing to be named
.main.kts
to be recognised for execution? It's a bit of an annoying naming restriction TBH Was it necessary? Previously any plain
.kts
name could be executed.
e

ephemient

03/26/2024, 12:58 PM
did it ever? I only remember third-party tools like kscript supporting that, not Kotlin itself
the subtype is there because scripts can have different definitions
j

Javier

03/26/2024, 12:59 PM
I think the
main
name is to allow calling it with
kotlin foo.main.kts
, without
main
, it was not working,
kotlin foo.kts
e

ephemient

03/26/2024, 12:59 PM
exactly.
main.kts
is one that is provided in the compiler distribution,
gradle.kts
is one provided by Gradle, etc.
👍 1
today i learned 2
d

darkmoon_uk

03/26/2024, 1:01 PM
Its probable I confused this because of earlier using kscript, as you said @ephemient
2 Views