Skip to content

Include/Import local file dependency #34

@xgouchet

Description

@xgouchet

In a project, I have multiple kotlin script files, and I have some methods I need to use in most, if not all script.

Is there an existing way to write these method in a single external file, and include it from the other scripts ?

eg :
utils.kts

fun foo(s : String) : String {
  //...
}

myscript.kts

#!/usr/bin/env kscript

//INCLUDE utils.kts

foo(args[0])

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions