简体   繁体   English

Android Studio:如何从搜索和其他功能中排除文档文件夹?

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

I have a huge auto-generated documentation folder in my Android project.我的 Android 项目中有一个巨大的自动生成的文档文件夹。

Unfortunately, all the auto-generated doc files clutter the refactoring and search functionality of Android Studio (eg rename, find references, search and replace).不幸的是,所有自动生成的 doc 文件都混淆了 Android Studio 的重构和搜索功能(例如重命名、查找引用、搜索和替换)。

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.一个明显的解决方案是将整个 Android Studio 项目移动到 git 存储库的子文件夹中,但我想避免这条路线。

How can I make Android Studio ignore a selected documentation folder?如何让 Android Studio 忽略选定的文档文件夹?

I have one more requirement: The solution must work for all fellow developers who clone the repo.我还有一个要求:该解决方案必须适用于所有克隆 repo 的开发人员。 I do not want any configuration that must be manually applied for each developer machine.我不想要任何必须为每台开发人员机器手动应用的配置。

The following snippet works for Android Studio 3.5.以下代码段适用于 Android Studio 3.5。 Put this into your root level build.gradle :将其放入您的根级别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.然后与 gradle 同步, mydocfolder应该在项目视图中以不同的颜色显示。 Note that excludeDirs.add(file('mydocfolder')) does not work.请注意, excludeDirs.add(file('mydocfolder'))不起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM