Bug 1123416 - Part 3: Limit IntelliJ objdir indexing. r=sebastian
authorNick Alexander <nalexander@mozilla.com>
Tue, 20 Oct 2015 15:30:44 -0700
changeset 302265 d8bf6eec26273b90f2a92c6d1e7a967ede086c2b
parent 302264 fe2090d75defeed0132976b20b2f9d31a9d073eb
child 302266 ef1e7dec5bad489be4556a10344626adefffc38d
push id5392
push userraliiev@mozilla.com
push dateMon, 14 Dec 2015 20:08:23 +0000
treeherdermozilla-beta@16ce8562a975 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1123416
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.
build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -91,12 +91,37 @@ afterEvaluate {
 }
 
 apply plugin: 'idea'
 
 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) {
 }