How to exclude source files in Android Studio?

#1

Hi, I would like to exclude source files in Android Studio without having to delete the files.

I tried to do it in build.gradle but I couldn’t figure out how to do it.
Here’s what I did.

    jni {
            source {
                srcDirs= appSrcDirs(ofRoot())

                includes = srcIncludes(ofRoot())
                excludes = srcExcludes(ofRoot())
                excludes.add(ofRoot()+"addons/ofxLua/src/bindings/desktop/ofBindings.cpp")
            }

But it doesn’t work.

I googled and tried everything I could but no luck.
I would appreciate any advice. Thanks.