aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-11-16 00:11:20 -0800
committerColin Cross <ccross@android.com>2017-11-17 11:22:08 -0800
commit35143d0466461f5d83dfc7aeda53b36a274f8cc8 (patch)
tree0edf1549368f4ce7f512f652da6e84158f89f816 /genrule
parentb1bd1aabca24a97cf319dfd5268a89e969f1dd98 (diff)
downloadbuild_soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.tar.gz
build_soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.tar.bz2
build_soong-35143d0466461f5d83dfc7aeda53b36a274f8cc8.zip
Fix genrules depending on Go tools
genrules lost the ability to depend on Go tools after I05e945f38915d49cd3c0ab72a86576949bc7eff2 which converted VisitDirectDeps from blueprint Modules to android Modules. Add VisitDirectDepsBlueprint to visit all modules including blueprint Modules, and use it in genrule. Also add a check for disabled modules that was being handled by VisitDirectDeps. Test: m checkbuild Change-Id: I65724283166c63596d071e598c08fed87ef32896
Diffstat (limited to 'genrule')
-rw-r--r--genrule/genrule.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/genrule/genrule.go b/genrule/genrule.go
index c5b7e1d3..c142c53e 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -158,7 +158,7 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
tools := map[string]android.Path{}
if len(g.properties.Tools) > 0 {
- ctx.VisitDirectDeps(func(module android.Module) {
+ ctx.VisitDirectDepsBlueprint(func(module blueprint.Module) {
switch ctx.OtherModuleDependencyTag(module) {
case android.SourceDepTag:
// Nothing to do
@@ -167,6 +167,14 @@ func (g *Module) GenerateAndroidBuildActions(ctx android.ModuleContext) {
var path android.OptionalPath
if t, ok := module.(HostToolProvider); ok {
+ if !t.(android.Module).Enabled() {
+ if ctx.AConfig().AllowMissingDependencies() {
+ ctx.AddMissingDependencies([]string{tool})
+ } else {
+ ctx.ModuleErrorf("depends on disabled module %q", tool)
+ }
+ break
+ }
path = t.HostToolPath()
} else if t, ok := module.(bootstrap.GoBinaryTool); ok {
if s, err := filepath.Rel(android.PathForOutput(ctx).String(), t.InstallPath()); err == nil {