Fix ALLOW_MISSING_DEPENDENCIES=true builds

Don't error out immediately if a SourceDepTag dependency is missing
if ALLOW_MISSING_DEPENDENCIES=true is set.

Test: forrest on unbundled build
Change-Id: I9077013e09e3ad0e90ae5163b26aace5b263e63a
This commit is contained in:
Colin Cross 2019-03-07 12:31:38 -08:00
parent 38bfc16c18
commit 1255a561e6
1 changed files with 10 additions and 2 deletions

View File

@ -1441,7 +1441,11 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string
if m := SrcIsModule(e); m != "" {
module := ctx.GetDirectDepWithTag(m, SourceDepTag)
if module == nil {
ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
if ctx.Config().AllowMissingDependencies() {
ctx.AddMissingDependencies([]string{m})
} else {
ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
}
continue
}
if srcProducer, ok := module.(SourceFileProducer); ok {
@ -1458,7 +1462,11 @@ func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string
if m := SrcIsModule(s); m != "" {
module := ctx.GetDirectDepWithTag(m, SourceDepTag)
if module == nil {
ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
if ctx.Config().AllowMissingDependencies() {
ctx.AddMissingDependencies([]string{m})
} else {
ctx.ModuleErrorf(`missing dependency on %q, is the property annotated with android:"path"?`, m)
}
continue
}
if srcProducer, ok := module.(SourceFileProducer); ok {