Merge "Added duplicates checking when extracting source deps."

am: 8596bab0b0

Change-Id: I78f7bcd8b435f6075e089eb2c997031cc6095347
This commit is contained in:
Nan Zhang 2017-04-19 19:55:56 +00:00 committed by android-build-merger
commit 637fc7e4f7

View file

@ -754,9 +754,16 @@ var SourceDepTag sourceDependencyTag
// modules listed in srcFiles using ":module" syntax
func ExtractSourcesDeps(ctx BottomUpMutatorContext, srcFiles []string) {
var deps []string
set := make(map[string]bool)
for _, s := range srcFiles {
if m := SrcIsModule(s); m != "" {
deps = append(deps, m)
if _, found := set[m]; found {
ctx.ModuleErrorf("found source dependency duplicate: %q!", m)
} else {
set[m] = true
deps = append(deps, m)
}
}
}