'Intellij : How to exclude file of particular types from indexing

I am working on an android project in Android Studio. My project uses a lot of *.cpp and *.hpp files. So when I open my project , Android Studio starts indexing the *.cpp files and becomes very slow. I tried this in gradle:

idea {
    module {
        excludeDirs += file '*.cpp; *.hpp; *.h'
    }
}

but it is not working. Is there a way to prevent indexing of particular file types from indexing in gradle?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source