I want to migrate from groovy to kotlin dsl in my gradle build script. I have 2 scripts in the project: build.gradle and publish-maven.gradle that attaches in the first one.
For groovy I apply script so:
apply from: "${rootProject.projectDir}/publish-maven.gradle"
For kotlin I found the same code will be look like:
apply(from = "publish-maven.gradle.kts")
But publish-maven.gradle.kts don't attaches to build.gradle.kts. At the top of the script in IDE constantly hangs warning:
Code insight unavailable (configuration for this script wasn't received during the last Gradle project import)
and kotlin syntax don't recognized.
I try also
apply(from = "${rootProject.projectDir}/publish-maven.gradle.kts")
or have found other examples but non of them helped.
What have I do to apply this script? Or the general question is how can I split build script into several files?
Gradle version: 6.7; JDK: 1.8; IDE: IntellijIdea