Exclude does not work at sourceSets

I am Android Devloper

i know sourceSets can use include & exclude

like Chromium build.gradle use include at sourceSets to join java file

and some example say can use exclude to

like : How can I exclude certain java files from being compiled?

but some answer say "exclude not work "

i know the full producetflavor must move class of flavor into flavor`s folder
and del the same name at main folder

but now l am lazy

i want use

sourceSets srcDirs += [’./src/flavor1/java’] and use exclude

exclude “.\main\java\xx\xxx\app\xxxApplication.kt”

but it not work

can help me ?

PS. why use exclude not move ? because i can use dir give file list let main git not change

THX

Your exclude is most probably simply not correct, it also looks quite fishy to me.
Especially as is starts with . and contains unescaped backslashes.
But from your description it is also - at least to me - unclear what exactly you tried.
Maybe you should provide an MCVE to make clear what you tried and how to fix it.