Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r=sebastian

IntelliJ's exclusion mechanism (for Gradle-based projects) is not very
flexible; we get just idea.module.excludeDirs.  This patch crawls the
file system to skip what we can.
This commit is contained in:
Nick Alexander 2015-10-20 15:30:44 -07:00
parent de06739bad
commit 80c6eb48a1

View File

@ -96,6 +96,31 @@ idea {
project {
languageLevel = '1.7'
}
module {
// Object directories take a huge amount of time for IntelliJ to index.
// Exclude them. Convention is that object directories start with obj.
// IntelliJ is clever and will not exclude the parts of the object
// directory that are referenced, if there are any.
def topsrcdirURI = file(topsrcdir).toURI()
excludeDirs += files(file(topsrcdir)
.listFiles({it.isDirectory()} as FileFilter)
.collect({topsrcdirURI.relativize(it.toURI()).toString()}) // Relative paths.
.findAll({it.startsWith('obj')}))
// If topobjdir is below topsrcdir, hide only some portions of that tree.
def topobjdirURI = file(topobjdir).toURI()
if (!topsrcdirURI.relativize(topobjdirURI).isAbsolute()) {
excludeDirs -= file(topobjdir)
excludeDirs += files(file(topobjdir).listFiles())
excludeDirs -= file("${topobjdir}/gradle")
excludeDirs -= file("${topobjdir}/mobile")
}
if (!mozconfig.substs.MOZ_INSTALL_TRACKING) {
excludeDirs += file("${topsrcdir}/mobile/android/thirdparty/com/adjust")
}
}
}
task wrapper(type: Wrapper) {