Can anyone explain how I could make Gradle stop ge...
# announcements
s
Can anyone explain how I could make Gradle stop generating
java
source roots for my Kotlin only projects?
d
That’s IntelliJ - untick the ‘Create directories for empty content roots automatically’ option on import, or in the Gradle settings for existing projects
s
Its not checked, and wouldn't that also remove the generated kotlin roots?
Even when I delete them in the project, if I add a child project to my gradle project, they regenerate in all projects
k
I usually put
Copy code
sourceSets {
    main.kotlin.srcDirs = ["src/main/"]
    main.java.srcDirs = []
}
To override the default ones.
👍 1