How to exclude from '.' source directory

I have following gradle build:

sourceSets.main.java {
    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 http://youtrack.jetbrains.com/issue/IDEA-128854