Merge "Added duplicates checking when extracting source deps."

This commit is contained in:
Treehugger Robot 2017-04-19 19:50:10 +00:00 committed by Gerrit Code Review
commit 8596bab0b0
1 changed files with 8 additions and 1 deletions

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)
}
}
}