Using IntelliJ to open a build.gradle file, in the \"Import Project from Gradle\" window, the \"Excluded Roots\" are pre-populated with the .gradle
build.gradle
.gradle
If you are using the Gradle Kotlin DSL, use the following snippet:
idea { module { excludeDirs.add(file("...")) } }