I'm trying to use gradle-script-kotlin
to automate a complicated build process, using IntelliJ as an editor. Following the advice found in a previous question, a colleague has gotten proper syntax highlighting in the build.gradle.kts
file, however, because of its complexity, I'm trying to split it up into a number of smaller files using the apply from example:
apply {
for (script in otherKotlinScripts)
from("buildscripts/$script.kts")
}
Alas, the completion only seems to actually work on build.gradle.kts
. On other kotlin-script files, free functions and anything that I import
work just fine, but gradle-specific things such as this task
closure:
task("foo") {
// intelliJ can't seem to figure out what the receiver is here,
// task itself gets highlighted in red, and its members fail
// to complete.
}
Is there a way to allow intellij to detect included files as gradle scripts?