How to exclude from '.' source directory

I have following gradle build: {
    srcDir '.'
    exclude 'src.not/**'

i.e. I have sources in root, but need to exclude one specific src.not directory. Why doesn’t it work? It is always shown in Intellij Idea as the whole root directory is in sources without any exceptions (excluded directory in IDEA).

Is it excluded from the Gradle command line? Maybe this is a limitation of the intellij plugin.

It works from cmd. I created a bug in Intellij , see