We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An attempt to include my utils per @file:Import("absolute/path/to/myutils.kt") doesn't work. More precisely: Unresolved reference: myFunction
@file:Import("absolute/path/to/myutils.kt")
Unresolved reference: myFunction
The text was updated successfully, but these errors were encountered:
Please provide additional information:
I have tested it with kscript 4.2.1, and both (absolute and relative) imports work.
Sorry, something went wrong.
It works in terminal, but it doesn't work in IDEA.
myutils.kt:
fun myprint(text: String) { println(text) }
myscript.kts:
#!/usr/bin/env kscript @file:Import("/absolute/path/to/myutils.kt") myprint("test")
build.gradle.kts:
plugins { id("org.jetbrains.kotlin.jvm") version "1.7.21" } repositories { mavenLocal() mavenCentral() } dependencies { implementation("org.jetbrains.kotlin:kotlin-stdlib") implementation("org.jetbrains.kotlin:kotlin-script-runtime:1.7.21") implementation("io.github.kscripting:kscript-annotations:1.5.0") } sourceSets.getByName("main").java.srcDirs("src") sourceSets.getByName("test").java.srcDirs("src")
Response: e: /home/user/.cache/kscript/idea_4fc...aa4/src/myscript.kts: (5, 1): Unresolved reference: myprint
e: /home/user/.cache/kscript/idea_4fc...aa4/src/myscript.kts: (5, 1): Unresolved reference: myprint
No branches or pull requests
An attempt to include my utils per
@file:Import("absolute/path/to/myutils.kt")
doesn't work.
More precisely:
Unresolved reference: myFunction
The text was updated successfully, but these errors were encountered: