Use VisitAllModuleVariantProxies in generateModuleTarget.
Also rename android.CommonPropertiesProvider to android.CommonModuleInfo.
Bug: 377723687
Test: Compare the ninja and mk files generated.
Change-Id: Iea46c16234204eef808b590b5cc1b43b5a874636
diff --git a/android/base_module_context.go b/android/base_module_context.go
index ab28676..1f89dea 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -211,6 +211,12 @@
// data modified by the current mutator.
VisitAllModuleVariants(visit func(Module))
+ // VisitAllModuleVariantProxies calls visit for each variant of the current module. Variants of a module are always
+ // visited in order by mutators and GenerateBuildActions, so the data created by the current mutator can be read
+ // from all variants if the current module is the last one. Otherwise, care must be taken to not access any
+ // data modified by the current mutator.
+ VisitAllModuleVariantProxies(visit func(proxy ModuleProxy))
+
// GetTagPath is supposed to be called in visit function passed in WalkDeps()
// and returns a top-down dependency tags path from a start module to current child module.
// It has one less entry than GetWalkPath() as it contains the dependency tags that
@@ -382,7 +388,7 @@
return &aModule
}
- if !OtherModuleProviderOrDefault(b, module, CommonPropertiesProviderKey).Enabled {
+ if !OtherModuleProviderOrDefault(b, module, CommonModuleInfoKey).Enabled {
if t, ok := tag.(AllowDisabledModuleDependency); !ok || !t.AllowDisabledModuleDependencyProxy(b, aModule) {
if b.Config().AllowMissingDependencies() {
b.AddMissingDependencies([]string{b.OtherModuleName(aModule)})
@@ -594,6 +600,10 @@
})
}
+func (b *baseModuleContext) VisitAllModuleVariantProxies(visit func(ModuleProxy)) {
+ b.bp.VisitAllModuleVariantProxies(visitProxyAdaptor(visit))
+}
+
func (b *baseModuleContext) PrimaryModule() Module {
return b.bp.PrimaryModule().(Module)
}