I had thought that the Kotlin DSL was automatically used in all .kts files, and didn’t require any plugin applications, but I saw kotlin-dsl applied in the Gradle project’s buildSrc/build.gradle.kts (I had imagined that applying kotlin-dsl might only be useful for changing the version of the DSL, but the line I saw didn’t specify any version…):
I know this is an old post, but it’s unanswered and showed up on a search of mine so I figure I’ll answer it.
Applying the kotlin-dsl plugin is required if the project contains any precompiled script plugins. This would be relatively common in buildSrc but we also have it applied in a common build plugin project.