Improve handling of generated include dirs

The exported include dirs includes both source and generated
directories (e.g. containing aidl generated headers). The latter are
always arch specific so if they are present they make all the include
directories arch specific.

This change separates the source and generated include dirs so that
the source include dirs (which are probably not arch specific) can be
optimized separately from the arch specific generated include dirs.

The FilterPathList() func was refactored to extract the more general
FilterPathListPredicate() func.

A number of tests needed to be updated to reflect the more optimal
snapshot creation.

Bug: 142918168
Test: m checkbuild
Change-Id: Id1a23d35a45b250ae2168834f9c2a65c86a5fd77
This commit is contained in:
Paul Duffin
2019-12-13 00:03:35 +00:00
parent a7cd8c8344
commit 57b9e1da75
3 changed files with 60 additions and 92 deletions

View File

@@ -512,8 +512,12 @@ func inPathList(p Path, list []Path) bool {
}
func FilterPathList(list []Path, filter []Path) (remainder []Path, filtered []Path) {
return FilterPathListPredicate(list, func(p Path) bool { return inPathList(p, filter) })
}
func FilterPathListPredicate(list []Path, predicate func(Path) bool) (remainder []Path, filtered []Path) {
for _, l := range list {
if inPathList(l, filter) {
if predicate(l) {
filtered = append(filtered, l)
} else {
remainder = append(remainder, l)