Don't run inspections in extracted AAR folders

Most "outputs" (such as build/intermediates/) are marked as generated
source roots, which means IntelliJ won't scan those folders for
warnings.

However, AAR libraries are extracted into special build folders
(currently build/intermediates/exploded-aar) which are *not* marked as
generated; that's necessary such that those folders are scanned (for
indexing purposes), handled as potential go-to-declaration targets
(since resource files there can contain for example themes extended in
the user's application). Therefore, by default, IntelliJ will analyze
all the files in the exploded AAR folders. When you have large
libraries like appcompat or play services, this not only takes a lot
of extra time to analyze. You also end up with a lot of errors in
files you can't edit. For example, with appcompat, you end up with
over 700 spelling mistake warnings, and with play services, you end up
with over a hundred unused namespace warnings, and over a hundred tag
has no children warnings!

Therefore, this CL tweaks the batch analysis runner which iterates
over PSI files to skip files that are found to be within an AAR
folder. This removes all the false positives and speeds up code
analysis quite significantly!

Change-Id: I3dfdd663689a9d75de0318b03e5c4d8c3c6c30f6
(cherry picked from commit 771f728d65f218292649115c1130de00b8c37ec4)
1 file changed