support PRODUCT_SOURCE_ROOT_DIRS product variable
Soong analyzes the entire source tree even though not every lunch target
needs to know about every module. For example, OEM sources can be
ignored for cuttlefish products. This functionality allows blueprint to
ignore a list of undesired directories.
Bug: 269457150
Change-Id: I1eec5d7b6a268cae4c633d8d89ed485598ebca45
diff --git a/android/namespace.go b/android/namespace.go
index b43ffdf..f357ca7 100644
--- a/android/namespace.go
+++ b/android/namespace.go
@@ -225,6 +225,10 @@
return ns, nil
}
+func (r *NameResolver) NewSkippedModule(ctx blueprint.NamespaceContext, name string, skipInfo blueprint.SkippedModuleInfo) {
+ r.rootNamespace.moduleContainer.NewSkippedModule(ctx, name, skipInfo)
+}
+
func (r *NameResolver) AllModules() []blueprint.ModuleGroup {
childLists := [][]blueprint.ModuleGroup{}
totalCount := 0
@@ -300,7 +304,7 @@
for _, name := range namespace.importedNamespaceNames {
imp, ok := r.namespaceAt(name)
if !ok {
- return fmt.Errorf("namespace %v does not exist", name)
+ return fmt.Errorf("namespace %v does not exist; Some necessary modules may have been skipped by Soong. Check if PRODUCT_SOURCE_ROOT_DIRS is pruning necessary Android.bp files.", name)
}
namespace.visibleNamespaces = append(namespace.visibleNamespaces, imp)
}