I want to exclude Kotlin files within a folder from the gradle build in Android Studio. This works fine as long as the files are .java
files but when converting them to Kotlin, the exclude command ignores the Kotlin files in the folder.
The following is used within my app modules build.gradle
file to exclude the folder:
sourceSets {
main {
java {
exclude '**/folderToExclude'
}
}
}
I already checked the following link, but the suggested solution didn't work: