Remove blueprint.Module helper functions
Now that blueprint_go_binary modules are wrapped in a module type
that implements android.Module Soong should never see a blueprint.Module.
Remove the versions of the context methods that allow working with
blueprint.Modules.
Genrules still need VisitDirectDepsAllowDisabled, as they use a hack
that adds dependencies on host tools after the prebuilts mutators have
run, which means they may have a dependency on a disabled prebuilt
and need to manually forward it to the corresponding source module.
Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: I9147b450269749326e8fe75c5af310bd2d898d8c
diff --git a/genrule/genrule.go b/genrule/genrule.go
index a48038b..878f6da 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -313,16 +313,14 @@
if len(g.properties.Tools) > 0 {
seenTools := make(map[string]bool)
- ctx.VisitDirectDepsBlueprint(func(module blueprint.Module) {
+ ctx.VisitDirectDepsAllowDisabled(func(module android.Module) {
switch tag := ctx.OtherModuleDependencyTag(module).(type) {
case hostToolDependencyTag:
tool := ctx.OtherModuleName(module)
- if m, ok := module.(android.Module); ok {
- // Necessary to retrieve any prebuilt replacement for the tool, since
- // toolDepsMutator runs too late for the prebuilt mutators to have
- // replaced the dependency.
- module = android.PrebuiltGetPreferred(ctx, m)
- }
+ // Necessary to retrieve any prebuilt replacement for the tool, since
+ // toolDepsMutator runs too late for the prebuilt mutators to have
+ // replaced the dependency.
+ module = android.PrebuiltGetPreferred(ctx, module)
switch t := module.(type) {
case android.HostToolProvider: