Mike76
Mike76

Reputation: 979

Android Studio: How to exclude Doc Folder from Search and other functionality?

I have a huge auto-generated documentation folder in my Android project.

Unfortunately, all the auto-generated doc files clutter the refactoring and search functionality of Android Studio (e.g. rename, find references, search and replace).

An obvious solution would be to move the entire Android Studio project to a subfolder of the git repo, but I want to avoid this route.

How can I make Android Studio ignore a selected documentation folder?

I have one more requirement: The solution must work for all fellow developers who clone the repo. I do not want any configuration that must be manually applied for each developer machine.

Upvotes: 3

Views: 588

Answers (1)

Mike76
Mike76

Reputation: 979

The following snippet works for Android Studio 3.5. Put this into your root level build.gradle:

apply plugin: 'idea'
idea {
    module {
        excludeDirs += file('mydocfolder')
    }
}

Then sync with gradle and mydocfolder should appear in a different color in the project view. Note that excludeDirs.add(file('mydocfolder')) does not work.

Upvotes: 4

Related Questions