Can we enforce use of Kotlin DSL?

We finally migrated all our Groovy build scripts to Kotlin DSL and life is good… for now.

I was wondering, how do we now stop new Groovy build scripts appearing in the project so that I don’t have to keep migrating any new ones which appear?

I know there’s one approach where I just search the entire project for *.gradle files and fail the build if any exist, but the project contains a lot of files, so it will be slow.

Is there some way from within the build to determine whether any of the loaded build scripts are Groovy ones?

As I understand it, Gradle doesn’t care whether the scripts are written in either Groovy or Kotlin, and they can both happily co-exist in the same project. So what problem are you trying to solve here?

FWIW, I personally think that Groovy is a better scripting language than Kotlin anyway. So it sounds as if you are asking how to force people to hit you with sticks :person_shrugging:.