Feature request: Gradle with bundled support for Kotlin DSL

Hi everyone. We’ve been using Gradle via Kotlin DSL for sometime now, on our build system. For many reasons (build repeatability, security - preventing supply chain attacks, etc.) our build agents do not have any Internet access, they can only pull stuff from our internal Maven repository, which, for the same reasons, does not have Internet access either.

This poses a problem if you use Kotlin DSL, because Gradle needs to download a lot of Kotlin-related dependencies to even compile *.gradle.kts files. Ultimately we just put a directory with these files on build agents but this is problematic if you want to upgrade Gradle to a new version - these dependencies might have changed. Putting them manually in our repository also is not a great option.

It seems to me, that there is a big shift to Kotlin DSL from Groovy build files, and it has become almost an integral part of Gradle. Therefore, wouldn’t it make sense to embed these necessary files in Gradle distribution? Or provide a variant of the distribution with these files embedded?

I believe that Kotlin DSL is already is a first-class citizen in Gradle ecosystem, and Gradle should support .gradle.kts files out-of-the-box, without needing to download additional libraries. Of course there might be some licencing issues I don’t know about.

What are your thoughts?