I’m experimenting with the Kotlin scripting support. I have it working with a custom script host from the command line, and now I’d like it to work in an IDE too.
- Two Gradle modules under the same root project, one that defines the scripting classes and one that is empty.
- The second depends on the first in both
- The first module contains the src/main/resources/META-INF/kotlin/script/templates directory with an empty file with the same fully qualified name as the script definition.
- The second module contains a test script but not in any source directory, just alongside the build.gradle.kts file.
Yet, no dice. If I create a file with the right registered extension IDEA knows it’s a Kotlin script, but it doesn’t understand my custom script definition. No code completion is offered for anything defined in it. I have built my project, and refreshed Gradle a bunch of times.
Any idea what I’m doing wrong?