From 1255a561e6757b0d42b040f7d5376e86440a57ba Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 7 Mar 2019 12:31:38 -0800 Subject: [PATCH] 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 --- android/module.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/android/module.go b/android/module.go index 64fbdacc2..c1f3e7936 100644 --- a/android/module.go +++ b/android/module.go @@ -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 {