Simplify vendor conditionals
Support vendor conditionals with no Go code.
Test: TestSoongConfigModule
Change-Id: I42546e7f17324921ada80f4d8e1cd399830f8dfc
diff --git a/android/namespace.go b/android/namespace.go
index 64ad7e9..9d7e8ac 100644
--- a/android/namespace.go
+++ b/android/namespace.go
@@ -162,6 +162,12 @@
return namespace
}
+// A NamelessModule can never be looked up by name. It must still implement Name(), but the return
+// value doesn't have to be unique.
+type NamelessModule interface {
+ Nameless()
+}
+
func (r *NameResolver) NewModule(ctx blueprint.NamespaceContext, moduleGroup blueprint.ModuleGroup, module blueprint.Module) (namespace blueprint.Namespace, errs []error) {
// if this module is a namespace, then save it to our list of namespaces
newNamespace, ok := module.(*NamespaceModule)
@@ -173,6 +179,10 @@
return nil, nil
}
+ if _, ok := module.(NamelessModule); ok {
+ return nil, nil
+ }
+
// if this module is not a namespace, then save it into the appropriate namespace
ns := r.findNamespaceFromCtx(ctx)