Merge "Make all Nameless modules have unique names"
This commit is contained in:
@@ -166,10 +166,10 @@ func (r *NameResolver) findNamespace(path string) (namespace *Namespace) {
|
||||
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()
|
||||
// A NamespacelessModule can never be looked up by name. It must still implement Name(), and the name
|
||||
// still has to be unique.
|
||||
type NamespacelessModule interface {
|
||||
Namespaceless()
|
||||
}
|
||||
|
||||
func (r *NameResolver) NewModule(ctx blueprint.NamespaceContext, moduleGroup blueprint.ModuleGroup, module blueprint.Module) (namespace blueprint.Namespace, errs []error) {
|
||||
@@ -183,7 +183,7 @@ func (r *NameResolver) NewModule(ctx blueprint.NamespaceContext, moduleGroup blu
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if _, ok := module.(NamelessModule); ok {
|
||||
if _, ok := module.(NamespacelessModule); ok {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
@@ -172,7 +172,7 @@ func (m *soongConfigModuleTypeImport) Name() string {
|
||||
"soong_config_module_type_import_" + fmt.Sprintf("%p", m)
|
||||
}
|
||||
|
||||
func (*soongConfigModuleTypeImport) Nameless() {}
|
||||
func (*soongConfigModuleTypeImport) Namespaceless() {}
|
||||
func (*soongConfigModuleTypeImport) GenerateAndroidBuildActions(ModuleContext) {}
|
||||
|
||||
// Create dummy modules for soong_config_module_type and soong_config_*_variable
|
||||
@@ -280,9 +280,9 @@ func SoongConfigModuleTypeFactory() Module {
|
||||
}
|
||||
|
||||
func (m *soongConfigModuleTypeModule) Name() string {
|
||||
return m.properties.Name
|
||||
return m.properties.Name + fmt.Sprintf("%p", m)
|
||||
}
|
||||
func (*soongConfigModuleTypeModule) Nameless() {}
|
||||
func (*soongConfigModuleTypeModule) Namespaceless() {}
|
||||
func (*soongConfigModuleTypeModule) GenerateAndroidBuildActions(ctx ModuleContext) {}
|
||||
|
||||
type soongConfigStringVariableDummyModule struct {
|
||||
@@ -315,15 +315,15 @@ func SoongConfigBoolVariableDummyFactory() Module {
|
||||
}
|
||||
|
||||
func (m *soongConfigStringVariableDummyModule) Name() string {
|
||||
return m.properties.Name
|
||||
return m.properties.Name + fmt.Sprintf("%p", m)
|
||||
}
|
||||
func (*soongConfigStringVariableDummyModule) Nameless() {}
|
||||
func (*soongConfigStringVariableDummyModule) Namespaceless() {}
|
||||
func (*soongConfigStringVariableDummyModule) GenerateAndroidBuildActions(ctx ModuleContext) {}
|
||||
|
||||
func (m *soongConfigBoolVariableDummyModule) Name() string {
|
||||
return m.properties.Name
|
||||
return m.properties.Name + fmt.Sprintf("%p", m)
|
||||
}
|
||||
func (*soongConfigBoolVariableDummyModule) Nameless() {}
|
||||
func (*soongConfigBoolVariableDummyModule) Namespaceless() {}
|
||||
func (*soongConfigBoolVariableDummyModule) GenerateAndroidBuildActions(ctx ModuleContext) {}
|
||||
|
||||
// importModuleTypes registers the module factories for a list of module types defined
|
||||
|
Reference in New Issue
Block a user