Add a few module visiting methods that return ModuleProxy.
Change a few places to use these new methods when visiting dependencies.
Bug: 358427516
Test: Manual verified the generated mk and ninja files.
Change-Id: I7426843d76d79d41eb60fce5e796c14f968a0f1d
diff --git a/android/proto.go b/android/proto.go
index 0d8e097..66faa20 100644
--- a/android/proto.go
+++ b/android/proto.go
@@ -74,14 +74,14 @@
flags = append(flags, JoinWithPrefix(rootProtoIncludeDirs.Strings(), "-I"))
}
- ctx.VisitDirectDepsWithTag(ProtoPluginDepTag, func(dep Module) {
- if hostTool, ok := dep.(HostToolProvider); !ok || !hostTool.HostToolPath().Valid() {
+ ctx.VisitDirectDepsProxyWithTag(ProtoPluginDepTag, func(dep ModuleProxy) {
+ if h, ok := OtherModuleProvider(ctx, dep, HostToolProviderKey); !ok || !h.HostToolPath.Valid() {
ctx.PropertyErrorf("proto.plugin", "module %q is not a host tool provider",
ctx.OtherModuleName(dep))
} else {
plugin := String(p.Proto.Plugin)
- deps = append(deps, hostTool.HostToolPath().Path())
- flags = append(flags, "--plugin=protoc-gen-"+plugin+"="+hostTool.HostToolPath().String())
+ deps = append(deps, h.HostToolPath.Path())
+ flags = append(flags, "--plugin=protoc-gen-"+plugin+"="+h.HostToolPath.String())
}
})