Convert tidyPhonySingleton, jdepsGeneratorSingleton and
genNoticeBuildRules to use ModuleProxy.
Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I7507a580e3533b01f552778a7815bcc43d301e23
diff --git a/cc/tidy.go b/cc/tidy.go
index 2373658..8e7f899 100644
--- a/cc/tidy.go
+++ b/cc/tidy.go
@@ -211,7 +211,7 @@
type tidyPhonySingleton struct{}
// Given a final module, add its tidy/obj phony targets to tidy/objModulesInDirGroup.
-func collectTidyObjModuleTargets(ctx android.SingletonContext, module android.Module,
+func collectTidyObjModuleTargets(ctx android.SingletonContext, module android.ModuleProxy,
tidyModulesInDirGroup, objModulesInDirGroup map[string]map[string]android.Paths) {
allObjFileGroups := make(map[string]android.Paths) // variant group name => obj file Paths
allTidyFileGroups := make(map[string]android.Paths) // variant group name => tidy file Paths
@@ -253,7 +253,7 @@
objModulesInDirGroup := make(map[string]map[string]android.Paths)
// Collect tidy/obj targets from the 'final' modules.
- ctx.VisitAllModules(func(module android.Module) {
+ ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
if ctx.IsFinalModule(module) {
collectTidyObjModuleTargets(ctx, module, tidyModulesInDirGroup, objModulesInDirGroup)
}
@@ -268,7 +268,7 @@
}
// The name for an obj/tidy module variant group phony target is Name_group-obj/tidy,
-func objTidyModuleGroupName(module android.Module, group string, suffix string) string {
+func objTidyModuleGroupName(module android.ModuleProxy, group string, suffix string) string {
if group == "" {
return module.Name() + "-" + suffix
}
@@ -327,7 +327,7 @@
}
// Add an all-OS group, with groupName, to include all os-specific phony targets.
-func addAllOSGroup(ctx android.SingletonContext, module android.Module, phonyTargetGroups map[string]android.Paths, groupName string, objTidyName string) {
+func addAllOSGroup(ctx android.SingletonContext, module android.ModuleProxy, phonyTargetGroups map[string]android.Paths, groupName string, objTidyName string) {
if len(phonyTargetGroups) > 0 {
var targets android.Paths
for group, _ := range phonyTargetGroups {
@@ -338,7 +338,7 @@
}
// Create one phony targets for each group and add them to the targetGroups.
-func genObjTidyPhonyTargets(ctx android.SingletonContext, module android.Module, objTidyName string, fileGroups map[string]android.Paths, targetGroups map[string]android.Path) {
+func genObjTidyPhonyTargets(ctx android.SingletonContext, module android.ModuleProxy, objTidyName string, fileGroups map[string]android.Paths, targetGroups map[string]android.Path) {
for group, files := range fileGroups {
groupName := objTidyModuleGroupName(module, group, objTidyName)
ctx.Phony(groupName, files...)