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

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

本文介绍了Android Studio:如何从搜索和其他功能中排除文档文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Android项目中有一个巨大的自动生成的文档文件夹.

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

不幸的是,所有自动生成的doc文件都扰乱了Android Studio的重构和搜索功能(例如,重命名,查找引用,搜索和替换).

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

一个显而易见的解决方案是将整个Android Studio项目移至git repo的子文件夹中,但我想避免这种做法.

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忽略选定的文档文件夹?

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.

推荐答案

以下代码段适用于Android Studio 3.5.将其放入您的根目录build.gradle:

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')
    }
}

然后与gradle和mydocfolder同步应在项目视图中以不同的颜色显示.请注意,excludeDirs.add(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.

这篇关于Android Studio:如何从搜索和其他功能中排除文档文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 03:47